Skip to content

Commit

Permalink
Merge branch 'mr/ramonat/e3-pytest-plugin' into 'master'
Browse files Browse the repository at this point in the history
Activate e3 pytest plugin

See merge request it/e3-testsuite!26
  • Loading branch information
enzbang committed Apr 3, 2024
2 parents 43e3a01 + 63559f9 commit b9f2de3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 31 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ e3-testsuite-report = "e3.testsuite.report.display:main"
[tool.setuptools.dynamic]
version = {file = "VERSION"}

[tool.pytest.ini_options]
addopts = "--failed-first --e3"

[tool.mypy]
# Ensure mypy works with namespace in which there is no toplevel
# __init__.py. Explicit_package_bases means that that mypy_path
Expand Down
13 changes: 11 additions & 2 deletions tests/tests/test_xunit.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,12 @@ def check_log(test_name, log):

captured = capsys.readouterr()
assert captured.out == ""
assert captured.err == ""

# Ensure that stderr is empty apart from the logs that are
# activated by the e3 pytest plugin
assert not [
line for line in captured.err.splitlines() if "DEBUG" not in line
]


def test_import_dirs(tmp_path):
Expand Down Expand Up @@ -427,4 +432,8 @@ def test_dangling_xfails(tmp_path, capsys):
" bar\n"
" foo (reason)\n"
)
assert captured.err == ""
# Ensure that stderr is empty apart from the logs that are
# activated by the e3 pytest plugin
assert not [
line for line in captured.err.splitlines() if "DEBUG" not in line
]
32 changes: 3 additions & 29 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,19 @@ isolated_build = True

[testenv]
deps =
pytest
mock
httpretty
e3-core
e3-core[test]
cov: pytest-cov
codecov: codecov

passenv = APPVEYOR* , TRAVIS , TRAVIS_* , CI

# Run testsuite with coverage when '-cov' is in the env name
commands=
{envpython} {toxinidir}/tests/gen-cov-config.py {toxinidir}/.coveragerc
pytest --ignore=build -v \
ci: --ci \
cov: --cov e3.testsuite --cov-report= --cov-fail-under=0 \
cov: --e3-cov-rewrite {envsitepackagesdir} src \
cov: --cov e3.testsuite \
[]
cov: {envpython} {toxinidir}/tests/fix-coverage-paths.py \
cov: {envsitepackagesdir} {toxinidir}/.coverage
cov: coverage html --fail-under=0
cov: coverage report
codecov: codecov


Expand Down Expand Up @@ -54,24 +47,5 @@ deps =
commands =
bandit -r e3 -ll -ii -s B102,B108,B301,B506

[testenv:docs]
basepython = python
deps =
pytest
mock
httpretty
sphinx
sphinx-autoapi
sphinx_rtd_theme
commands =
py.test --collect-only --requirement-coverage-report={toxinidir}/docs/source/requirement_coverage.yaml
python docs/generate-req-coverage.py {toxinidir}/docs/source/requirements.yaml \
{toxinidir}/docs/source/requirement_coverage.yaml \
{toxinidir}/docs/source/requirement_coverage.rst
python -msphinx -M html {toxinidir}/docs/source {toxinidir}/docs/build

[flake8]
ignore = D100,D101,D102,D102,D103,D104,D105,D106,D107,D203,D403,D213,E123,E133,E241,E242,W503,E704

[pytest]
addopts = --failed-first

0 comments on commit b9f2de3

Please sign in to comment.