-
Notifications
You must be signed in to change notification settings - Fork 231
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
Problem printing or storing longrepr when using pytest-xdist (introduced in 1.18.0) #241
Comments
at first glance this looks like a artefact of the recently introduced support for serialized tracebacks |
It's tagged "needs information" -- is there anything you need from me? |
whops, actually not, thanks for the note |
Do you guys want me to take a look? |
@timyhou that would be great, thanks for the offer! |
|
My initial guess was totally wrong. The issue is in the serialize_report method. It will actually mutate the initial report.longrepr object seen here. I can fix this by doing a deepcopy at line 114 and 115. We can't deepcopy the entire report because of SlaveController. Incidentally this breaks a few tests because of equality, so I have to tweak a few testsDoes this sound like a reasonable approach? |
at first glance, just copy the dict contents shallow, as far as i can tel lthe mutation is shallow as well and put a comment on it just to be sure that nobody missunderstands |
Issue #241 Make copy during serialization of reprtraceback and reprcr…
I assume you know from your testing, but I just wanted to confirm from my side that this completely resolves the issue (I meant to do so back when the merge was done, but I only remembered when the new release came out). Thank you! |
Hi,
I currently have the following code, which works with pytest-xdist 1.17.1, but broken in 1.18.0, when running with
-nX
where X > 0. With X=0, or without -n at all, it works in all versions.test_foo.py:
conftest.py:
With 1.18.0 or higher, I get the following error (this log was from 1.20.1):
Is there a better way to get a traceback when using pytest-xdist? (note that in my real code, I filter on
report.failed
andreport.when
as well; the snippet above is just a minimal case to demonstrate the basic concept)The text was updated successfully, but these errors were encountered: