Commits

Ronny Pfannschmidt committed 0121003

add test for the decorator recursion missdetection and a testenv that depends on the external tools

Comments (0)

Files changed (2)

testing/code/test_excinfo.py

         recindex = traceback.recursionindex()
         assert recindex is None
 
+    def test_traceback_messy_recursion(self):
+        #XXX: simplified locally testable version
+        decorator = py.test.importorskip('decorator').decorator
+        
+        def log(f, *k, **kw):
+            print('%s %s' % (k, kw))
+            f(*k, **kw)
+        log = decorator(log)
+
+        def fail():
+            raise ValueError('')
+
+        fail = log(log(fail))
+
+        excinfo = py.test.raises(ValueError, fail)
+        assert excinfo.traceback.recursionindex() is None
+
+
+
     def test_traceback_getcrashentry(self):
         def i():
             __tracebackhide__ = True
         assert s == "  File '<string>':1 in <module>\n  ???\n"
 
 def test_excinfo_no_python_sourcecode(tmpdir):
+    #XXX: simplified locally testable version
     tmpdir.join('test.txt').write("{{ h()}}:")
 
     jinja2 = py.test.importorskip('jinja2')
 commands=
     {envpython} -m pytest --confcutdir=.. -rfsxX --junitxml={envlogdir}/junit-{envname}0.xml [io_ code]
 
+[testenv:external]
+deps=
+    pytest
+    jinja2
+    decorator
+commands=
+    py.test --confcutdir=.. -rfsxX --junitxml={envlogdir}/junit-{envname}.xml testing/code
+
 [pytest]
 rsyncdirs = conftest.py py doc testing
 addopts = -rxXf