1. Marcus Smith
  2. distlib


Vinay Sajip  committed 7b23d06

Take different approach to skipping unnecessary tests.

  • Participants
  • Parent commits df87e11
  • Branches default

Comments (0)

Files changed (2)

File tests/distlib_tests.py

View file
  • Ignore whitespace
 # Copyright (C) 2012 The Python Software Foundation.
 # See LICENSE.txt and CONTRIBUTORS.txt.
+import sys
+_ver = sys.version_info[:2]
 from test_glob import GlobTestCase
 from test_version import (VersionTestCase, CompatibilityTestCase,
                           LegacyVersionTestCase, SemanticVersionTestCase,
 from test_resources import (ZipResourceTestCase, FileResourceTestCase,
 from test_scripts import ScriptTestCase
-from test_shutil import TestCopyFile, TestMove, TestShutil
-from test_sysconfig import TestSysConfig, MakefileTests
+if _ver == (2, 6):
+    from test_shutil import TestCopyFile, TestMove, TestShutil
+    from test_sysconfig import TestSysConfig, MakefileTests
 from test_util import UtilTestCase, ProgressTestCase, FileOpsTestCase
 from test_pypi_dist import TestDistInfo, TestReleaseInfo, TestReleasesList
 from test_pypi_server import PyPIServerTest

File tests/test_sysconfig.py

View file
  • Ignore whitespace
 import support
-# Some tests don't work in Python 3.3 venvs
-_in_venv = hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix
 class TestSysConfig(unittest.TestCase):
         # XXX more platforms to tests here
-    @unittest.skipIf(_in_venv, "test not relevant in venvs")
     def test_get_config_h_filename(self):
         config_h = sysconfig.get_config_h_filename()
         self.assertTrue(os.path.isfile(config_h), config_h)
-    @unittest.skipIf(_in_venv, "test not relevant in venvs")
     def test_user_similar(self):
         # Issue #8759: make sure the posix scheme for the users
         # is similar to the global posix_prefix one
         self.assertGreater(len(sys.stdout.getvalue().split('\n')), 0)
-    @unittest.skipIf(_in_venv, "test not relevant in venvs")
     @unittest.skipIf(sys.platform == 'win32', 'does not apply to Windows')
     def test_ldshared_value(self):
         ldflags = sysconfig.get_config_var('LDFLAGS')
         self.assertIn(ldflags.strip(), ldshared.strip())
-    @unittest.skipIf(_in_venv, "test not relevant in venvs")
     @unittest.skipUnless(sys.platform == "darwin", "test only relevant on MacOSX")
     def test_platform_in_subprocess(self):
         my_platform = sysconfig.get_platform()
     def tearDown(self):
-    @unittest.skipIf(_in_venv, "test not relevant in venvs")
                     'Test is not Windows compatible')
     def test_get_makefile_filename(self):