Skip to content

Commit

Permalink
Merge pull request scipy#22261 from crusaderky/tst_markers
Browse files Browse the repository at this point in the history
  • Loading branch information
lucascolley authored Jan 6, 2025
2 parents f9749da + 846b142 commit e5bb1f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/source/dev/api-dev/array_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ The following pytest markers are available:
* ``array_api_backends``: this marker is automatically added by the ``xp`` fixture to
all tests that use it. This is useful e.g. to select all and only such tests::

python dev.py test -b all -- -m array_api_backends
python dev.py test -b all -m array_api_backends

Note that this includes tests that use the ``xp`` fixture indirectly through another
array API fixture, such as ``@pytest.mark.usefixtures("skip_xp_backends")``, even if
Expand Down
8 changes: 6 additions & 2 deletions scipy/_lib/_testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,12 @@ def __call__(self, label="fast", verbose=1, extra_argv=None, doctests=False,

pytest_args = ['--showlocals', '--tb=short']

if extra_argv:
pytest_args += list(extra_argv)
if extra_argv is None:
extra_argv = []
pytest_args += extra_argv
if any(arg == "-m" or arg == "--markers" for arg in extra_argv):
# Likely conflict with default --mode=fast
raise ValueError("Must specify -m before --")

if verbose and int(verbose) > 1:
pytest_args += ["-" + "v"*(int(verbose)-1)]
Expand Down

0 comments on commit e5bb1f2

Please sign in to comment.