擅长:python、mysql、java
<p>有关从<strong>xunit1</strong>移动到<strong>xunit2</strong>的官方声明/文件,请阅读:<a href="https://docs.pytest.org/en/stable/deprecations.html#junit-family-default-value-change-to-xunit2" rel="nofollow noreferrer">docs.pytest.org</a></p>
<p>此外,如果您的项目包含<em><strong>pytest.ini</strong></em>文件,则可以直接从文件中设置<em>junit\u系列</em>用法,如:</p>
<pre><code># pytest.ini
[pytest]
minversion = 6.0
junit_family=xunit2
junit_suite_name = Pytest Tests
addopts = -ra -q -v -s junitxml=path/to/pytest_results/pytest.xml
</code></pre>