pytest-sugar
pytest-sugar copied to clipboard
invalid reports when used with `-rA`, repeats 3 times with instafail
pytest-sugar reports strange things when used with -rA
Command used to run pytest
pytest test_example.py
Test file
def test_example():
print(1)
pass
Output
Test session starts (platform: linux, Python 3.8.5, pytest 6.2.2, pytest-sugar 0.9.4)
rootdir: /home/stas/hf/transformers-stas
plugins: forked-1.3.0, xdist-2.2.0, sugar-0.9.4, instafail-0.4.2
collecting ...
test_example.py ✓ 100% ██████████
Results (0.02s):
1 passed
with -rA
$ pytest -rA test_example.py
Test session starts (platform: linux, Python 3.8.5, pytest 6.2.2, pytest-sugar 0.9.4)
rootdir: /home/stas/hf/transformers-stas
plugins: forked-1.3.0, xdist-2.2.0, sugar-0.9.4, instafail-0.4.2
collecting ...
test_example.py ✓ 100% ██████████
====================================================================== PASSES =======================================================================
___________________________________________________________________ test_example ____________________________________________________________________
--------------------------------------------------------------- Captured stdout call ----------------------------------------------------------------
1
___________________________________________________________________ test_example ____________________________________________________________________
--------------------------------------------------------------- Captured stdout call ----------------------------------------------------------------
1
============================================================== short test summary info ==============================================================
PASSED test_example.py::test_example
PASSED test_example.py::test_example
PASSED test_example.py::test_example
Results (0.02s):
1 passed
2 problems:
- stdout is dumped twice
- PASSED report is printed trice
If combined with instafail
It now also reports the test 3 times! ✓✓✓
pytest -rA test_example.py --instafail
====================================================================== test session starts =======================================================================
platform linux -- Python 3.8.5, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
rootdir: /home/stas/hf/transformers-stas
plugins: forked-1.3.0, xdist-2.2.0, sugar-0.9.4, instafail-0.4.2
collected 1 item
test_example.py ✓✓✓ [100%]
============================================================================= PASSES =============================================================================
__________________________________________________________________________ test_example __________________________________________________________________________
---------------------------------------------------------------------- Captured stdout call ----------------------------------------------------------------------
1
__________________________________________________________________________ test_example __________________________________________________________________________
---------------------------------------------------------------------- Captured stdout call ----------------------------------------------------------------------
1
==================================================================== short test summary info =====================================================================
PASSED test_example.py::test_example
PASSED test_example.py::test_example
PASSED test_example.py::test_example
======================================================================= 3 passed in 0.06s ========================================================================
W/o -rA
pytest test_example.py --instafail
====================================================================== test session starts =======================================================================
platform linux -- Python 3.8.5, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
rootdir: /home/stas/hf/transformers-stas
plugins: forked-1.3.0, xdist-2.2.0, sugar-0.9.4, instafail-0.4.2
collected 1 item
test_example.py ✓✓✓ [100%]
======================================================================= 3 passed in 0.01s ========================================================================
Thanks.