Commit 7a0f63b2 authored by Dag Sverre Seljebotn's avatar Dag Sverre Seljebotn Committed by Mark Florisson

Test for problem with CythonUtilityCode overwriting __test__

parent 31609acb
...@@ -43,6 +43,9 @@ class CythonUtilityCode: ...@@ -43,6 +43,9 @@ class CythonUtilityCode:
def get_tree(self): def get_tree(self):
from AnalysedTreeTransforms import AutoTestDictTransform from AnalysedTreeTransforms import AutoTestDictTransform
# The AutoTestDictTransform creates the statement "__test__ = {}",
# which when copied into the main ModuleNode overwrites
# any __test__ in user code; not desired
excludes = [AutoTestDictTransform] excludes = [AutoTestDictTransform]
import Pipeline import Pipeline
......
"""
>>> f()
hello from cython scope, value=4
hello from cython.view scope, value=4
hello from cython scope, value=3
hello from cython.view scope, value=3
"""
cimport cython cimport cython
from cython cimport _testscope as tester from cython cimport _testscope as tester
...@@ -13,6 +5,13 @@ from cython.view cimport _testscope as viewtester ...@@ -13,6 +5,13 @@ from cython.view cimport _testscope as viewtester
def f(): def f():
"""
>>> f()
hello from cython scope, value=4
hello from cython.view scope, value=4
hello from cython scope, value=3
hello from cython.view scope, value=3
"""
print cython._testscope(4) print cython._testscope(4)
print cython.view._testscope(4) print cython.view._testscope(4)
print tester(3) print tester(3)
......
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