aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-12-28 17:19:50 -0500
committerJason R. Coombs <jaraco@jaraco.com>2016-12-28 20:19:26 -0500
commitb911a237e03a3892f423f3d5e2ec0caad1986b8d (patch)
treec0a98aae3c34ff730ee03541396f2e3b1a6fcbec /setuptools/tests
parent6a960cb9e8cf17385e3b8a52d46cf71a9747e19d (diff)
downloadexternal_python_setuptools-b911a237e03a3892f423f3d5e2ec0caad1986b8d.tar.gz
external_python_setuptools-b911a237e03a3892f423f3d5e2ec0caad1986b8d.tar.bz2
external_python_setuptools-b911a237e03a3892f423f3d5e2ec0caad1986b8d.zip
Add two more tests for _iter_code per #866, capturing the apparent expectation in the byte-code processing that's now failing on Python 3.6.
Diffstat (limited to 'setuptools/tests')
-rw-r--r--setuptools/tests/test_depends.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/setuptools/tests/test_depends.py b/setuptools/tests/test_depends.py
index e0cfa880..fcf2a636 100644
--- a/setuptools/tests/test_depends.py
+++ b/setuptools/tests/test_depends.py
@@ -14,3 +14,15 @@ class TestGetModuleConstant:
val = depends.get_module_constant(mod_name, 'value')
assert val == 'three, sir!'
assert 'setuptools.tests.mod_with_constant' not in sys.modules
+
+
+class TestIterCode:
+ def test_empty(self):
+ code = compile('', '<string>', mode='exec')
+ expected = (100, 0), (83, None)
+ assert tuple(depends._iter_code(code)) == expected
+
+ def test_constant(self):
+ code = compile('value = "three, sir!"', '<string>', mode='exec')
+ expected = (100, 0), (90, 0), (100, 1), (83, None)
+ assert tuple(depends._iter_code(code)) == expected