Commits

Ezio Melotti committed f5d3108

#17779: test_osx_env now works with unittest test discovery. Patch by Zachary Ware.

Comments (0)

Files changed (2)

Lib/test/test_osx_env.py

 import sysconfig
 import unittest
 
+@unittest.skipUnless(sys.platform == 'darwin' and
+                     sysconfig.get_config_var('WITH_NEXT_FRAMEWORK'),
+                     'unnecessary on this platform')
 class OSXEnvironmentVariableTestCase(unittest.TestCase):
     def _check_sys(self, ev, cond, sv, val = sys.executable + 'dummy'):
         with EnvironmentVarGuard() as evg:
     def test_pythonexecutable_sets_sys_executable(self):
         self._check_sys('PYTHONEXECUTABLE', '==', 'sys.executable')
 
-def test_main():
-    if sys.platform == 'darwin' and sysconfig.get_config_var('WITH_NEXT_FRAMEWORK'):
-        run_unittest(OSXEnvironmentVariableTestCase)
-
 if __name__ == "__main__":
-    test_main()
+    unittest.main()
 - Issue #12820: add tests for the xml.dom.minicompat module.
   Patch by John Chandler and Phil Connell.
 
+- Issue #17779: test_osx_env now works with unittest test discovery.
+  Patch by Zachary Ware.
+
 - Issue #17766: test_iterlen now works with unittest test discovery.
   Patch by Zachary Ware.
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.