Skip to content

Commit 6281fb8

Browse files
tchaikovnyh
authored andcommitted
test/pytest.ini: ignore warning on deprecated record_property fixture
`record_property` generates XML which is not compatible with xunit2, so pytest decided to deprecated when the generating xunit reports. and pytest generates following warning when a test failure is reported using this fixture: ``` object_store/test_backup.py:337: PytestWarning: record_property is incompatible with junit_family 'xunit2' (use 'legacy' or 'xunit1') ``` this warning is not related to the test, but more about how we report a failure using pytrest. it is distracting, so let's silence it. See also pytest-dev/pytest#5202 Signed-off-by: Kefu Chai <[email protected]> Closes #22067
1 parent 2718062 commit 6281fb8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/pytest.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,18 @@ norecursedirs = manual perf lib
1414
# Ignore warnings about HTTPS requests without certificate verification
1515
# (see issue #15287). Pytest breaks urllib3.disable_warnings() in conftest.py,
1616
# so we need to do this here.
17+
#
18+
# Ignore warning of
19+
# PytestWarning: record_property is incompatible with junit_family 'xunit2' (use 'legacy' or 'xunit1')
20+
# Because `record_property` adds <properties> inside <testcase>, which is not allowed
21+
# as per the latest xunit2 schema. see
22+
# https://github.com/windyroad/JUnit-Schema/blob/master/JUnit.xsdtestcase,
23+
# an alternative is `record_testsuite_property`, but we want to attach test
24+
# log on a per-test basis. so let's continue using this feature before
25+
# switching to xunit1 or legacy.
1726
filterwarnings =
1827
ignore::urllib3.exceptions.InsecureRequestWarning
28+
ignore:record_property is incompatible with junit_family:pytest.PytestWarning
1929

2030
tmp_path_retention_count = 1
2131
tmp_path_retention_policy = failed

0 commit comments

Comments
 (0)