-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
TST: skip|xfail_xp_backends
disregards reason=
#22131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
raise ValueError("please provide a singleton `reason` " | ||
"when using `np_only`") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant with pytest's own error
c059340
to
ca4d32e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
what happens if we perform a |
The reason from cpu_only took precedence, and it's most likely not what we want. I've updated the PR: @skip_xp_backends(cpu_only=True, reason="cpu reason")
@skip_xp_backends("torch", reason="torch reason")
def test1(xp):
pass $ python dev.py test -v
scipy/signal/tests/test_signaltools.py::test1[numpy] PASSED [ 20%]
scipy/signal/tests/test_signaltools.py::test1[array_api_strict] PASSED [ 40%]
scipy/signal/tests/test_signaltools.py::test1[torch] SKIPPED (torch reason) [ 60%]
scipy/signal/tests/test_signaltools.py::test1[cupy] SKIPPED (cpu reason) [ 80%]
scipy/signal/tests/test_signaltools.py::test1[jax.numpy] PASSED
$ SCIPY_DEVICE=cuda python dev.py test -v
scipy/signal/tests/test_signaltools.py::test1[numpy] PASSED [ 20%]
scipy/signal/tests/test_signaltools.py::test1[array_api_strict] PASSED [ 40%]
scipy/signal/tests/test_signaltools.py::test1[torch] SKIPPED (torch reason) [ 60%]
scipy/signal/tests/test_signaltools.py::test1[cupy] SKIPPED (cpu reason) [ 80%]
scipy/signal/tests/test_signaltools.py::test1[jax.numpy] SKIPPED (cpu reason) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you update the docstring now that a custom reason is allowed with cpu_only
done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @crusaderky !
skip|xfail_xp_backends
disregards reason=
Fix bug where
would disregard the user-provided reason and instead always used the default.
Also, when a test is decorated by
the reason for the specific backend will now trump the one given for cpu_only (see evidence in comment below).