aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-12-28 17:03:33 -0500
committerJason R. Coombs <jaraco@jaraco.com>2016-12-28 20:19:17 -0500
commit6a960cb9e8cf17385e3b8a52d46cf71a9747e19d (patch)
tree7585319f1f645356741cf781a2a95579635e2854
parent6d69dd73b900cff84ee142ad82967dd025a75b72 (diff)
downloadexternal_python_setuptools-6a960cb9e8cf17385e3b8a52d46cf71a9747e19d.tar.gz
external_python_setuptools-6a960cb9e8cf17385e3b8a52d46cf71a9747e19d.tar.bz2
external_python_setuptools-6a960cb9e8cf17385e3b8a52d46cf71a9747e19d.zip
Add tests capturing failure of depends.get_module_constant on Python 3.6. Ref #866.
-rwxr-xr-xpytest.ini2
-rw-r--r--setuptools/tests/mod_with_constant.py1
-rw-r--r--setuptools/tests/test_depends.py16
3 files changed, 18 insertions, 1 deletions
diff --git a/pytest.ini b/pytest.ini
index c814b316..11a213db 100755
--- a/pytest.ini
+++ b/pytest.ini
@@ -1,5 +1,5 @@
[pytest]
-addopts=--doctest-modules --ignore release.py --ignore setuptools/lib2to3_ex.py --ignore tests/manual_test.py --ignore tests/test_pypi.py --ignore tests/shlib_test --doctest-glob=pkg_resources/api_tests.txt --ignore scripts/upload-old-releases-as-zip.py --ignore pavement.py
+addopts=--doctest-modules --ignore release.py --ignore setuptools/lib2to3_ex.py --ignore tests/manual_test.py --ignore tests/test_pypi.py --ignore tests/shlib_test --doctest-glob=pkg_resources/api_tests.txt --ignore scripts/upload-old-releases-as-zip.py --ignore pavement.py --ignore setuptools/tests/mod_with_constant.py
norecursedirs=dist build *.egg setuptools/extern pkg_resources/extern .*
flake8-ignore =
setuptools/site-patch.py F821
diff --git a/setuptools/tests/mod_with_constant.py b/setuptools/tests/mod_with_constant.py
new file mode 100644
index 00000000..ef755dd1
--- /dev/null
+++ b/setuptools/tests/mod_with_constant.py
@@ -0,0 +1 @@
+value = 'three, sir!'
diff --git a/setuptools/tests/test_depends.py b/setuptools/tests/test_depends.py
new file mode 100644
index 00000000..e0cfa880
--- /dev/null
+++ b/setuptools/tests/test_depends.py
@@ -0,0 +1,16 @@
+import sys
+
+from setuptools import depends
+
+
+class TestGetModuleConstant:
+
+ def test_basic(self):
+ """
+ Invoke get_module_constant on a module in
+ the test package.
+ """
+ mod_name = 'setuptools.tests.mod_with_constant'
+ val = depends.get_module_constant(mod_name, 'value')
+ assert val == 'three, sir!'
+ assert 'setuptools.tests.mod_with_constant' not in sys.modules