Skip to content

Commit

Permalink
test: Consolidate and update pytest options in pyproject.toml (#121)
Browse files Browse the repository at this point in the history
* Remove .coveragerc and consolidate pytest options to pyproject.toml.
* Apply 'configuring pytest' recommendations for pytest from Scikit-HEP
(c.f. https://scikit-hep.org/developer/pytest#configuring-pytest ).
   - '-ra' includes a report after pytest runs with a summary on all tests
     except those that passed. From 'pytest --help':
     > -r chars: show extra test summary info as specified by chars: (f)ailed,
     > (E)rror, (s)kipped, (x)failed, (X)passed, (p)assed, (P)assed with output,
     > (a)ll except passed (p/P), or (A)ll. (w)arnings are enabled by default
     > (see --disable-warnings), 'N' can be used to reset the list. (default: 'fE').
   - '-Wd' enables all warnings.
     > It adds 'd' to sys.warnoptions, which in turn adds a new first entry to
     > _warnings.filters which matches all warnings and enables the "default"
     > behavior, which is to show it once per execution of the Python interpreter.
     c.f. https://mail.python.org/pipermail/python-dev/2010-April/099116.html
   - '--showlocal' prints locals in tracebacks.
   - '--strict-markers' will complain if you use an unspecified fixture.
   - '--strict-config' will raise an error if there is a mistake in the pytest config.
   - 'log_cli_level = "info"' reports INFO and above log messages on a failure.
* Remove '-r sx' from pytest calls in CI jobs as pyproject.toml now applies '-ra'.
* Remove .coverage file added (accidentally?) in 134b6b4
  • Loading branch information
matthewfeickert committed Feb 10, 2022
1 parent 2962fad commit 314078e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 18 deletions.
13 changes: 0 additions & 13 deletions .coveragerc

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Test with pytest
run: |
pytest -r sx
pytest
- name: Report coverage with Codecov
if: matrix.python-version == '3.10'
Expand Down
10 changes: 7 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ exclude = '''
minversion = "6.0"
xfail_strict = true
addopts = [
"--ignore=setup.py",
"--ignore=docs/",
"-ra",
"-Wd",
"--cov=yadage",
"--cov-config=.coveragerc",
"--cov-branch",
"--showlocals",
"--strict-markers",
"--strict-config",
"--cov-report=term-missing",
"--cov-report=xml",
"--cov-report=html",
]
log_cli_level = "info"
testpaths = "tests"
1 change: 0 additions & 1 deletion tests/testspecs/cartesian_mapreduce/.coverage

This file was deleted.

0 comments on commit 314078e

Please sign in to comment.