-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
type: questiongeneral question, might be closed after 2 weeks of inactivitygeneral question, might be closed after 2 weeks of inactivity
Description
This is verified against pytest-3.6.3 on CentOS 7 with Python 3.6.5 (installed via IUS).
When running pytest with tests marked with @pytest.mark.xfail
and the result is an XPASS, enabling xfail_strict as follows does not cause the test suite to fail:
[tool.pytest]
xfail_strict = True
When enabling as follows, the same test suite will fail:
[pytest]
xfail_strict = True
The pip list
output is:
atomicwrites (1.1.5)
attrs (18.1.0)
more-itertools (4.2.0)
pip (9.0.3)
pluggy (0.6.0)
py (1.5.4)
pytest (3.6.3)
setuptools (39.0.1)
six (1.11.0)
SSCCE:
- Install poetry.
- Set up basic demo project.
# keep your environment clean
poetry new --name example test-xfail-strict
cd test-xfail-strict
sed -i tests/test_example.py -e 's/def/import pytest\n\n@pytest.mark.xfail\ndef/'
- Demonstrate correct behavior with deprecated configuration
echo -e "[pytest]\nxfail_strict=true" > setup.cfg
poetry run pytest
- Demonstrate incorrect behavior with new configuration
echo -e "[tool.pytest]\nxfail_strict=true" > setup.cfg
poetry run pytest
Metadata
Metadata
Assignees
Labels
type: questiongeneral question, might be closed after 2 weeks of inactivitygeneral question, might be closed after 2 weeks of inactivity