1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/tox.ini
Ryan S. Brown ae5c370737 Fail hard when tests pass that are expected to fail
`@pytest.mark.xfail()` can be used to decorate tests that don't yet
pass. By default, if I wrote a test like this:

```
@pytest.mark.xfail()
def test_naughty():
    assert 1 == 1
```

Then Pytest would allow this test to pass without notifying that an
expected-fail *didn't* fail. To make that happen, you have to set
xfail_strict=True so that the above test would cause the tests to fail.
2017-12-21 10:27:38 -08:00

31 lines
1.1 KiB
INI

[tox]
envlist = py26,py27,py35,py36
[testenv]
deps = -c{toxinidir}/test/runner/requirements/constraints.txt
-r{toxinidir}/test/runner/requirements/ansible-test.txt
-r{toxinidir}/test/runner/requirements/sanity.txt
-r{toxinidir}/test/runner/requirements/units.txt
commands =
python --version
# The recommended method of running tests with tox is to execute
# ansible-test directly and use the --tox and --python options.
# The commands below are provided as a convenience for those who
# prefer to run tox directly instead of through ansible-test.
{toxinidir}/test/runner/ansible-test compile --python default -v
{toxinidir}/test/runner/ansible-test sanity --python default -v
{toxinidir}/test/runner/ansible-test units --python default -v
passenv =
# Pass HOME to the test environment to avoid the missing HOME env
# variable error. See issue: #20424
HOME
[pytest]
xfail_strict = true
[flake8]
# These are things that the devs don't agree make the code more readable
# E402 module level import not at top of file
ignore = E402
# not all the devs believe in 80 column line length
max-line-length = 160