You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. First of all thank you for the sphinx-needs and sphinx-test-reports extensions. They are great and helps as to keep everything as code.
I discovered a strange behavior with pytest and sphinx-test-reports when a fixture raises an error the test cases using that fixture are still passing.
Here is a small example, which I hope is reproducible:
# test_example.pyimportpytest@pytest.fixturedeffixture_foo():
raiseException('ERROR on fixture')
deftest_foo(fixture_foo):
print("I'm OK")
The above test file is called using the following command:
pytest test_example.py --junitxml=junit.xml
Then in an RST file I simply call the test-report directive:
FOO
=====
.. test-report:: My Report:id: FOO
:file: /workspaces/tmp/junit.xml
It's important to mention that pytest doesn't contain any additional configuration nor sphinx. Also the test suite detects that there is 1 error.
HTML Results
Test case is shown as passed
In the imported data, there is 1 error and one test case which is passing.
Hi. First of all thank you for the sphinx-needs and sphinx-test-reports extensions. They are great and helps as to keep everything as code.
I discovered a strange behavior with
pytest
andsphinx-test-reports
when a fixture raises an error the test cases using that fixture are still passing.Here is a small example, which I hope is reproducible:
The above test file is called using the following command:
Then in an RST file I simply call the
test-report
directive:It's important to mention that pytest doesn't contain any additional configuration nor sphinx. Also the test suite detects that there is 1 error.
HTML Results
![image](https://user-images.githubusercontent.com/43955949/152609370-5c33a6c6-3190-436d-a3d6-6c5ed5a10119.png)
Test case is shown as passed
In the imported data, there is 1 error and one test case which is passing.
![image](https://user-images.githubusercontent.com/43955949/152609581-5e6f7f96-b4b0-4a91-ab73-b3af4ef9b0eb.png)
Packages
pytest 6.2.5
Sphinx 4.4.0
sphinx-data-viewer 0.1.2
sphinx-test-reports 0.3.6
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-needs 0.7.5
sphinxcontrib-plantuml 0.22
The text was updated successfully, but these errors were encountered: