Vinay Sajip avatar Vinay Sajip committed 7b23d06

Take different approach to skipping unnecessary tests.

Comments (0)

Files changed (2)

tests/distlib_tests.py

 # 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,
                             CacheTestCase)
 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

tests/test_sysconfig.py

 
 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)
         finally:
             os.unlink(link)
 
-    @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
         _main()
         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):
         os.unlink(self.TESTFN)
 
-    @unittest.skipIf(_in_venv, "test not relevant in venvs")
     @unittest.skipIf(sys.platform.startswith('win'),
                     'Test is not Windows compatible')
     def test_get_makefile_filename(self):
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.