1 new commit in pytest:
https://bitbucket.org/hpk42/pytest/changeset/88a2c2a4cf70/ changeset: 88a2c2a4cf70 user: hpk42 date: 2011-12-10 09:49:21 summary: fix issue99 - internalerror with --resultlog now produce better output. the fix depends on another change in the py lib which unifies the output for native and non-native traceback formatting styles affected #: 5 files diff -r 896c7b1b455b435848d8957445edd18c0741c061 -r 88a2c2a4cf7097adb8579654bf7df8b6cc5c67cc CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,11 @@ Changes between 2.2.0 and 2.2.1.dev ---------------------------------------- +- fix issue99 (in pytest and py) internallerrors with resultlog now + produce better output - fixed by normalizing pytest_internalerror + input arguments. +- fix traceback issues (in pytest and py) improve traceback output + in conjunction with jinja2 and cython which hack tracebacks - fix issue93 (in pytest and pytest-xdist) avoid "delayed teardowns": the final test in a test node will now run its teardown directly instead of waiting for the end of the session. Thanks Dave Hunt for diff -r 896c7b1b455b435848d8957445edd18c0741c061 -r 88a2c2a4cf7097adb8579654bf7df8b6cc5c67cc _pytest/__init__.py --- a/_pytest/__init__.py +++ b/_pytest/__init__.py @@ -1,2 +1,2 @@ # -__version__ = '2.2.1.dev2' +__version__ = '2.2.1.dev3' diff -r 896c7b1b455b435848d8957445edd18c0741c061 -r 88a2c2a4cf7097adb8579654bf7df8b6cc5c67cc _pytest/resultlog.py --- a/_pytest/resultlog.py +++ b/_pytest/resultlog.py @@ -91,5 +91,8 @@ self.log_outcome(report, code, longrepr) def pytest_internalerror(self, excrepr): - path = excrepr.reprcrash.path + reprcrash = getattr(excrepr, 'reprcrash', None) + path = getattr(reprcrash, "path", None) + if path is None: + path = "cwd:%s" % py.path.local() self.write_log_entry(path, '!', str(excrepr)) diff -r 896c7b1b455b435848d8957445edd18c0741c061 -r 88a2c2a4cf7097adb8579654bf7df8b6cc5c67cc setup.py --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ name='pytest', description='py.test: simple powerful testing with Python', long_description = long_description, - version='2.2.1.dev2', + version='2.2.1.dev3', url='http://pytest.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], @@ -32,7 +32,7 @@ author_email='holger at merlinux.eu', entry_points= make_entry_points(), # the following should be enabled for release - install_requires=['py>=1.4.5'], + install_requires=['py>=1.4.6.dev4'], classifiers=['Development Status :: 6 - Mature', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', @@ -70,4 +70,4 @@ return {'console_scripts': l} if __name__ == '__main__': - main() \ No newline at end of file + main() diff -r 896c7b1b455b435848d8957445edd18c0741c061 -r 88a2c2a4cf7097adb8579654bf7df8b6cc5c67cc testing/test_resultlog.py --- a/testing/test_resultlog.py +++ b/testing/test_resultlog.py @@ -133,23 +133,26 @@ assert lines[14].startswith('X ') assert len(lines) == 15 - def test_internal_exception(self): + @pytest.mark.parametrize("style", ("native", "long", "short")) + def test_internal_exception(self, style): # they are produced for example by a teardown failing - # at the end of the run + # at the end of the run or a failing hook invocation try: raise ValueError except ValueError: excinfo = py.code.ExceptionInfo() reslog = ResultLog(None, py.io.TextIO()) - reslog.pytest_internalerror(excinfo.getrepr()) + reslog.pytest_internalerror(excinfo.getrepr(style=style)) entry = reslog.logfile.getvalue() entry_lines = entry.splitlines() assert entry_lines[0].startswith('! ') - assert os.path.basename(__file__)[:-9] in entry_lines[0] #.pyc/class + if style != "native": + assert os.path.basename(__file__)[:-9] in entry_lines[0] #.pyc/class assert entry_lines[-1][0] == ' ' assert 'ValueError' in entry + def test_generic(testdir, LineMatcher): testdir.plugins.append("resultlog") testdir.makepyfile(""" Repository URL: https://bitbucket.org/hpk42/pytest/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. _______________________________________________ py-svn mailing list py-svn@codespeak.net http://codespeak.net/mailman/listinfo/py-svn