mutilated pytest stack traces
See original GitHub issueOn Python 2.7, stack traces are garbled when using the fs pytest fixture:
test.py:
def test(fs):
assert 0
bash:
$ virtualenv venv --no-site-packages
$ . venv/bin/activate
(venv) $ pip install pytest pyfakefs
(venv) $ pytest test.py
Output:
_____________________________________ test ______________________________________
fs = <pyfakefs.fake_filesystem.FakeFilesystem object at 0x10efdbc50>
> ???
E assert 0
test.py:2: AssertionError
Output without including fs fixture:
_____________________________________ test ______________________________________
def test():
> assert 0
E assert 0
test.py:2: AssertionError
Any ideas? Sorry if this has already been reported somewhere (I couldn’t find an issue for it).
Python version: 2.7.14 pip version: 10.0.1 virtualenv version: 15.1.0 pip freeze output:
attrs==17.4.0
funcsigs==1.0.2
more-itertools==4.1.0
pluggy==0.6.0
py==1.5.3
pyfakefs==3.4.1
pytest==3.5.1
six==1.11.0
Thanks, Karl
Issue Analytics
- State:
- Created 5 years ago
- Comments:19 (15 by maintainers)
Top Results From Across the Web
mutilated pytest stack traces · Issue #381 · jmcgeheeiv/pyfakefs
On Python 2.7, stack traces are garbled when using the fs pytest fixture: test.py: def test(fs): assert 0 bash: $ virtualenv venv --no-site-packages ......
Read more >How can I make py.test print stack traces for test failures ...
I can't seem to find an option to print out the stack traces as each test completes. -s doesn't help. python · pytest...
Read more >Managing pytest's output
The --full-trace causes very long traces to be printed on error (longer than --tb=long ). It also ensures that a stack trace is...
Read more >Print or retrieve a stack traceback
This module provides a standard interface to extract, format and print stack traces of Python programs. It exactly mimics the behavior of the...
Read more >Capturing Stack Traces
It's great being able to log events, but what if we want to log something critical, like a crash? We can do that...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thank you for the great triage and the Python 3 fix, @mrbean-bremen.
I will give it a try, but like @mrbean-bremen, I am not so experienced with pytest.
I seem to have found a solution for this under Python 3 (happened there too), but under Python 2 it still does not work. Not faking the
openfunction fixes it, but that is not an option…