aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-01-01 11:36:43 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-01-01 11:36:43 -0500
commitc10ab0661e13776146e2948c67593c65035ccf8c (patch)
treef2b9f8765ea089368c716cfaee85cabad7b45fd1
parent81c4405729df21fe5326df0bc2f2ed3e99d3e735 (diff)
downloadexternal_python_setuptools-c10ab0661e13776146e2948c67593c65035ccf8c.tar.gz
external_python_setuptools-c10ab0661e13776146e2948c67593c65035ccf8c.tar.bz2
external_python_setuptools-c10ab0661e13776146e2948c67593c65035ccf8c.zip
Unify detection of bytecode
-rw-r--r--setuptools/tests/__init__.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/setuptools/tests/__init__.py b/setuptools/tests/__init__.py
index bb3a0b31..900b0199 100644
--- a/setuptools/tests/__init__.py
+++ b/setuptools/tests/__init__.py
@@ -31,6 +31,11 @@ def makeSetup(**args):
distutils.core._setup_stop_after = None
+needs_bytecode = pytest.mark.skipif(
+ not hasattr(dep, 'get_module_constant'),
+ reason="bytecode support not available",
+)
+
class TestDepends:
def testExtractConst(self):
@@ -65,21 +70,15 @@ class TestDepends:
f,p,i = dep.find_module('setuptools.tests')
f.close()
+ @needs_bytecode
def testModuleExtract(self):
- if not hasattr(dep, 'get_module_constant'):
- # skip on non-bytecode platforms
- return
-
from email import __version__
assert dep.get_module_constant('email','__version__') == __version__
assert dep.get_module_constant('sys','version') == sys.version
assert dep.get_module_constant('setuptools.tests','__doc__') == __doc__
+ @needs_bytecode
def testRequire(self):
- if not hasattr(dep, 'extract_constant'):
- # skip on non-bytecode platformsh
- return
-
req = Require('Email','1.0.3','email')
assert req.name == 'Email'