Skip to content

Add user_properties to test case report#59

Open
kurt-cb wants to merge 9 commits intopytest-dev:masterfrom
kurt-cb:master
Open

Add user_properties to test case report#59
kurt-cb wants to merge 9 commits intopytest-dev:masterfrom
kurt-cb:master

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