Commit b911a237 authored by Jason R. Coombs's avatar Jason R. Coombs

Add two more tests for _iter_code per #866, capturing the apparent expectation...

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.
parent 6a960cb9
...@@ -14,3 +14,15 @@ class TestGetModuleConstant: ...@@ -14,3 +14,15 @@ class TestGetModuleConstant:
val = depends.get_module_constant(mod_name, 'value') val = depends.get_module_constant(mod_name, 'value')
assert val == 'three, sir!' assert val == 'three, sir!'
assert 'setuptools.tests.mod_with_constant' not in sys.modules 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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment