Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aaa5d1c

Browse files
committed
#17779: test_osx_env now works with unittest test discovery. Patch by Zachary Ware.
1 parent bca1a26 commit aaa5d1c

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

Lib/test/test_osx_env.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
import sysconfig
99
import unittest
1010

11+
@unittest.skipUnless(sys.platform == 'darwin' and
12+
sysconfig.get_config_var('WITH_NEXT_FRAMEWORK'),
13+
'unnecessary on this platform')
1114
class OSXEnvironmentVariableTestCase(unittest.TestCase):
1215
def _check_sys(self, ev, cond, sv, val = sys.executable + 'dummy'):
1316
with EnvironmentVarGuard() as evg:
@@ -27,9 +30,5 @@ def _check_sys(self, ev, cond, sv, val = sys.executable + 'dummy'):
2730
def test_pythonexecutable_sets_sys_executable(self):
2831
self._check_sys('PYTHONEXECUTABLE', '==', 'sys.executable')
2932

30-
def test_main():
31-
if sys.platform == 'darwin' and sysconfig.get_config_var('WITH_NEXT_FRAMEWORK'):
32-
run_unittest(OSXEnvironmentVariableTestCase)
33-
3433
if __name__ == "__main__":
35-
test_main()
34+
unittest.main()

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ Tests
120120
- Issue #12820: add tests for the xml.dom.minicompat module.
121121
Patch by John Chandler and Phil Connell.
122122

123+
- Issue #17779: test_osx_env now works with unittest test discovery.
124+
Patch by Zachary Ware.
125+
123126
- Issue #17766: test_iterlen now works with unittest test discovery.
124127
Patch by Zachary Ware.
125128

0 commit comments

Comments
 (0)