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

Add user_properties to test case report #59

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

kurt-cb
Copy link

@kurt-cb kurt-cb commented Sep 7, 2022

instead of creating a new API for adding properties, capture pytest user_properties. This removes the need for a special fixture and also works correctly with pytest-parallel

Setting internal variables with the record_nunit_property is non-functional in pytest-parallel as the modifications are done in a different process (nunit_xml is a sub-process copy, so the changes are lost). user_properties are reported and re-synchronized with the main process via the test_report. This is a better location for test case properties IMHO.

@kurt-cb
Copy link
Author

kurt-cb commented Sep 7, 2022

steps to reproduce:

  1. create a test case that uses record_nunit_property to set "TEST" to "123" and record_property to set "TEST2" to "ABC"
  2. run test with pytest-parallel enabled for 1 cpu
  3. examine test-output.xml and notice that "TEST" property with "123" is missing (due to the update in a child process) and "TEST2" is set to "ABC" as it was marshaled to the main process in the test_report's user_properties.

@kurt-cb
Copy link
Author

kurt-cb commented Sep 7, 2022

this PR addresses #60 by updating the properties from the standard record_property builtin fixture.

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

Successfully merging this pull request may close these issues.

2 participants