擅长:python、mysql、java
<p>在pytest.ini文件中添加以下行:</p>
<pre><code>junit_family=legacy
</code></pre>
<p>如果要保留<code> junitxml</code>选项的默认行为。也可以接受新版本<code>xunit2</code>,但不显式定义junit_族变量</p>
<p>从本质上讲,警告所说的是您在您的应用程序中提供了<code> junitxml</code>选项</p>
<pre><code>run
name: Tests
</code></pre>
<p>节未指定junit\u族变量。您需要开始显式定义它以删除警告或接受新的默认值</p>
<p><a href="https://docs.pytest.org/en/latest/customize.html" rel="nofollow noreferrer">This thread goes into more details about where to find the .ini file for pytest.</a></p>