Join GitHub today
Make record_xml_property generic and compatible with xdist and markers. #2770
This PR changes the
The implementation adds a list of
Currently, to maintain the functionality, the JUnit adds those properties to the XML report.
In addition, this allows markers to modify (add, delete) user properties as desired. This is documented in this PR and a particular use case is:
# Content of conftest.py def pytest_collection_modifyitems(session, config, items): for item in items: marker = item.get_marker('test_id') if marker is not None: test_id = marker.args item.user_properties.append(('test_id', test_id))
That allows to use markers as follows:
# Content of test_function.py @pytest.mark.test_id(1501) def test_function(): assert True
thanks for this addition, this is a nicely done next step,
however we do have some major problems there
a) this breaks backward compatibility harshly - a removal without a deprecation period is unacceptable
a backward compatibility fixture that's just an alias triggering a deprecating warning for the node should be fine
b) this removes the warning about being experimental - which would remove a safety net that's there for our own sake
Some thoughts we should discuss:
Hi @nicoddemus , sorry I didn't commented earlier, I had my priorities shifted and was unable to keep working on this branch. In relation to your comments:
No worries, thanks for getting back to this.
Good point, I agree.
Fair enough, let's go with that!
You are correct, we just use the "features" branch as the target for enhancements/features for the next minor release. This should not go into a new bugfix release (