-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
The environment:
- pytest=8.2.2
- pytest-nunit=1.0.7
- pytest-xdist=3.6.1
- python=3.10.8
The script:
import pytest
@pytest.mark.parametrize("params", [(1, 1),(2, 1)])
def test_temp(params, add_nunit_attachment):
p = f"{str(params[0])}.txt"
with open(p, "tw") as f:
f.write("")
add_nunit_attachment(p, p)
assert params[0] == params[1]
The script when run without arguments produces test-output.xml containing:
<attachments>
<attachment>
<filePath>1.txt</filePath>
<description>1.txt</description>
</attachment>
</attachments>
as expected.
When run with -n 2 (2 xdist workers) produces test-output.xml with no attachments.
I don't see this behavior mentioned in the known limitations at the moment.
We use pytest-azurepipelines to run tests in CI and publishing attachments of the failing tests resulting files is a very useful instrument of the test failure diagnostics.
Metadata
Metadata
Assignees
Labels
No labels