Duplicated counting test case numbers with pytest-rerunfailures plugin
@gnikonorov ya está trabajando en esto.
Desde el 2/8/2020.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 481
- Forks
- 110
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de pytest-dev/pytest-rerunfailures
-
Zero rerun delay can abort with OverflowError for a large finite backoff factorPosiblemente ocupada @AryanRG la tomó hace 15 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Non-finite rerun delay settings abort pytest with INTERNALERRORPosiblemente ocupada @Arham-Begani la tomó hace 14 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
-
fail-on-flaky returns success after a rerun with xdistPosiblemente ocupada @harbinresearcher la tomó hace 16 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 15/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
pytest-dev/pytest-rerunfailures#326 · 7 comentarios ·
-
Add ability to raise runtime warnings on rerunsPosiblemente ocupada @LouisDeconinck la tomó hace 45 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
pytest-dev/pytest-rerunfailures#318 · 2 comentarios ·
Todos los issues de pytest-dev/pytest-rerunfailures
Issues similares
-
breaking change
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
check-skill-pages: show fixture build errors when a build failsPosiblemente ocupada @ShahadatTest la tomó hoy. Abiertogood first issue P2
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
coco-research/coco#439 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
esphome/home-assistant-addon#274 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
endurain-project/endurain#882 ·
Los mantenedores suelen responder en 1 día
-
Add unit tests for metrics.pyAbiertogood first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100