Duplicated counting test case numbers with pytest-rerunfailures plugin
@gnikonorov がすでに取り組んでいます。
2020年8月2日 から。
評価
この issue はまだ評価されていません。
説明
If one test cases failed in teardown method with --reruns=1, this case will be calculated as 2 cases.
Test code:
class Test1(object):
def teardown_method(self, method):
raise Exception('tewrdown method error')
def test1(self):
pass
with --reruns=1:
$ py.test test_rerun.py -v -s --junitxml=test-result.xml --reruns=1
=============================================================== test session starts ================================================================
platform darwin -- Python 2.7.14, pytest-2.9.1, py-1.7.0, pluggy-0.3.1 -- /Users/jzhang/miniconda2/envs/p2/bin/python
cachedir: .cache
rootdir: /Users/jzhang/Desktop/test_log, inifile:
plugins: rerunfailures-4.1
collected 1 items
test_rerun.py::Test1::test1 PASSED
test_rerun.py::Test1::test1 RERUN
test_rerun.py::Test1::test1 PASSED
test_rerun.py::Test1::test1 ERROR
---------------------------------------- generated xml file: /Users/jzhang/Desktop/test_log/test-result.xml ----------------------------------------
====================================================================== ERRORS ======================================================================
_________________________________________________________ ERROR at teardown of Test1.test1 _________________________________________________________
self = <test_rerun.Test1 object at 0x104073190>, method = <bound method Test1.test1 of <test_rerun.Test1 object at 0x104073190>>
def teardown_method(self, method):
> raise Exception('tewrdown method error')
E Exception: tewrdown method error
test_rerun.py:4: Exception
==================================================== 2 passed, 1 error, 1 rerun in 0.02 seconds ====================================================
(p2) # ~/Desktop/test_log [18:10:33] C:1
$ more test-result.xml
<?xml version="1.0" encoding="utf-8"?><testsuite errors="1" failures="0" name="pytest" skips="0" tests="2" time="0.015"><testcase classname="test_rerun.Test1" file="test_rerun.py" line="5" name="test1" time="0.00033712387085"></testcase><testcase classname="test_rerun.Test1" file="test_rerun.py" line="5" name="test1" time="0.000302791595459"><error message="test setup failure">self = <test_rerun.Test1 object at 0x104073190>, method = <bound method Test1.test1 of <test_rerun.Test1 object at 0x104073190>>
def teardown_method(self, method):
> raise Exception('tewrdown method error')
E Exception: tewrdown method error
test_rerun.py:4: Exception</error></testcase></testsuite>
It calculated the number of test cases as 2, we can see tests="2".
when run this case without --retrun=1:
$ py.test test_rerun.py -v -s --junitxml=test-result.xml
=============================================================== test session starts ================================================================
platform darwin -- Python 2.7.14, pytest-2.9.1, py-1.7.0, pluggy-0.3.1 -- /Users/jzhang/miniconda2/envs/p2/bin/python
cachedir: .cache
rootdir: /Users/jzhang/Desktop/test_log, inifile:
plugins: rerunfailures-4.1
collected 1 items
test_rerun.py::Test1::test1 PASSED
test_rerun.py::Test1::test1 ERROR
---------------------------------------- generated xml file: /Users/jzhang/Desktop/test_log/test-result.xml ----------------------------------------
====================================================================== ERRORS ======================================================================
_________________________________________________________ ERROR at teardown of Test1.test1 _________________________________________________________
self = <test_rerun.Test1 object at 0x103d40d50>, method = <bound method Test1.test1 of <test_rerun.Test1 object at 0x103d40d50>>
def teardown_method(self, method):
> raise Exception('tewrdown method error')
E Exception: tewrdown method error
test_rerun.py:4: Exception
======================================================== 1 passed, 1 error in 0.02 seconds =========================================================
(p2) # ~/Desktop/test_log [18:19:55] C:1
$ more test-result.xml
<?xml version="1.0" encoding="utf-8"?><testsuite errors="1" failures="0" name="pytest" skips="0" tests="1" time="0.015"><testcase classname="test_rerun.Test1" file="test_rerun.py" line="5" name="test1" time="0.000448226928711"><error message="test setup failure">self = <test_rerun.Test1 object at 0x103d40d50>, method = <bound method Test1.test1 of <test_rerun.Test1 object at 0x103d40d50>>
def teardown_method(self, method):
> raise Exception('tewrdown method error')
E Exception: tewrdown method error
test_rerun.py:4: Exception</error></testcase></testsuite>
It calculated the number of test cases as 1, we can see tests="1", it looks more reasonable.
- 主要言語
- Python
- スター
- 481
- フォーク
- 110
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pytest-dev/pytest-rerunfailures のほかの issue
-
Zero rerun delay can abort with OverflowError for a large finite backoff factor対応中かも @AryanRG が 14 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
Non-finite rerun delay settings abort pytest with INTERNALERROR対応中かも @Arham-Begani が 13 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
-
fail-on-flaky returns success after a rerun with xdist対応中かも @harbinresearcher が 15 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
pytest-dev/pytest-rerunfailures#326 · コメント 7 件 ·
-
Add ability to raise runtime warnings on reruns対応中かも @LouisDeconinck が 44 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
pytest-dev/pytest-rerunfailures#318 · コメント 2 件 ·
pytest-dev/pytest-rerunfailures の issue をすべて見る
似ている issue
-
_chunk_scan_fwd launches its Triton kernel without a device guard: NaN when a model is split across GPUs対応中かも @toddwbucy が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
state-spaces/mamba#1072 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
loopj/aiovantage#414 ·
メンテナーはふだん 1 日以内に返信
-
power_mismatch_deline docstring: the rear-to-total RMAD conversion has an extra bifaciality factorオープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
pvlib/pvlib-python#2929 ·
メンテナーはふだん 1 日以内に返信
-
data good first issue launch-day unverified
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
BradGroux/wow-forever-mission-control#8 ·
メンテナーはふだん 1 日以内に返信
-
check bilibili falsely reports read/subtitle as broken: live_test fixture BV1GJ411x7h7 is gone (404)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Panniantong/Agent-Reach#889 ·
メンテナーはふだん 2 日以内に返信