Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Competing ExceptionInfo classes. Losing stacktraces in terminal output #2433

Closed
Magicjarvis opened this issue May 24, 2017 · 0 comments
Closed

Comments

@Magicjarvis
Copy link

Magicjarvis commented May 24, 2017

There are two ExceptionInfo classes and one of them seems to be eating exception stacktraces. any ideas?
one lives here venv/src/py/py/_code/code.py (I've added a print to its init and called it "ExceptionInfo #1"
and the other lives here /venv/lib/python3.5/site-packages/py/_code/code.py (ExceptionInfo #2)

Minimal example
Given this test file
test_repro.py

def really_do_the_assert():
    assert 1 == 0

def test_repro():
    really_do_the_assert()

class TestFoo(unittest.TestCase):
    def test_ugh(self):
        assert 1 == 0

I get this result from pytest test/test_repro.py

collected 2 items

test/test_repro.py ExceptionInfo #1 tup=None, exprinfo=None
FF
===Flaky Test Report===


===End Flaky Test Report===

============================================== FAILURES ==============================================
_____________________________________________ test_repro _____________________________________________
/Users/jarvis/webdev/py/example_repo/test/test_repro.py:5: AssertionError: assert 1 == 0
__________________________________________ TestFoo.test_ugh __________________________________________

self = <test.test_repro.TestFoo testMethod=test_ugh>

    def test_ugh(self):
>       assert 1 == 0
E       AssertionError: assert 1 == 0

test/test_repro.py:15: AssertionError
---------------------------------------- Captured stdout call ----------------------------------------
ExceptionInfo #2 tup=(<class 'AssertionError'>, AssertionError('assert 1 == 0',), <traceback object at 0x109ea8888>), exprinfo=None
====================================== 2 failed in 4.75 seconds ======================================
(venv) ➜  example_repo git:(test-repro) ✗

pytest version 3.0.7; mac os x

The ExceptionInfo used for test_repro() doesn't have an exception tuple associated, which is why i assume it can't print the stacktrace. Any ideas what's up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant