From aaa5d1c5821b67dd9e3d33011d345b8839793254 Mon Sep 17 00:00:00 2001 From: Ezio Melotti Date: Fri, 19 Apr 2013 05:38:18 +0300 Subject: [PATCH] #17779: test_osx_env now works with unittest test discovery. Patch by Zachary Ware. --- Lib/test/test_osx_env.py | 9 ++++----- Misc/NEWS | 3 +++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Lib/test/test_osx_env.py b/Lib/test/test_osx_env.py index 24ec2b4403..d8eb981b64 100644 --- a/Lib/test/test_osx_env.py +++ b/Lib/test/test_osx_env.py @@ -8,6 +8,9 @@ import sys 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: @@ -27,9 +30,5 @@ class OSXEnvironmentVariableTestCase(unittest.TestCase): 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() diff --git a/Misc/NEWS b/Misc/NEWS index de1bd8865c..341a3de45b 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -120,6 +120,9 @@ Tests - 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. -- 2.40.0