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
test: Consolidate and update pytest options in pyproject.toml (#1773)
* 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').
- '--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.
- 'filterwarnings = ["error"]' sets all warnings to be errors and allows for
some warnings to be ignored with -W warn control syntax.
(c.f. https://docs.python.org/dev/using/cmdline.html#cmdoption-W )
* Remove `tests/__init__.py` as no reason to make the tests directory importable.
* Remove '-r sx' from pytest calls in CI jobs as pyproject.toml now applies '-ra'.
* Use 'with pytest.warns' to assert expected warnings in tests.
(c.f. https://docs.pytest.org/en/7.0.x/how-to/capture-warnings.html#warns )
* Override error on filterwarnings for the 'minimum supported dependencies' GHA workflow
as it is testing for the oldest releases that work with the latest API, not the oldest
releases that are warning free.
* Remove unused nbQA options for black from pyproject.toml.
- Amends PR #1598
'ignore:invalid value encountered in true_divide:RuntimeWarning', #FIXME
87
+
'ignore:invalid value encountered in add:RuntimeWarning', #FIXME
88
+
"ignore:In future, it will be an error for 'np.bool_' scalars to be interpreted as an index:DeprecationWarning", #FIXME: tests/test_tensor.py::test_pdf_eval[pytorch]
89
+
'ignore:Creating a tensor from a list of numpy.ndarrays is extremely slow. Please consider converting the list to a single numpy.ndarray with:UserWarning', #FIXME: tests/test_optim.py::test_minimize[no_grad-scipy-pytorch-no_stitch]
90
+
'ignore:divide by zero encountered in true_divide:RuntimeWarning', #FIXME: pytest tests/test_tensor.py::test_pdf_calculations[numpy]
0 commit comments