-
Notifications
You must be signed in to change notification settings - Fork 45
Clean way to optional enable/disable extensions #25
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
Comments
Bare minimum it would be nice if we automatically skipped tests if required attributes don't exist, like: @pytest.mark.skipif(not hasattr(xp, "linalg")), reason="extension not found") This could be a more immediate thing we do. Could be refactored to something like Side note: If we're interested in tracking the dependencies of the array module generally, EVERY test method could have something like @pytest.mark.xp_deps(["all", "equal"])
def test_foo(...):
...
assert xp.all(...)
assert xp.equal(...) This would probably be too much of a headache, but something I'd consider in the future when this test suite is otherwise "complete". Good exercise for us to track dependencies too. EDIT: I now realise this idea is particularly awkward as it'll need to declare dependencies on array object behaviour too. Also I see now with your recent comment that |
|
Is the set of active marks accessible from inside the test functions? It might be necessary to have branching logic in the test itself. |
Can't think of a way to do that myself. I suppose you could send marks as parameters and as the marks meta, i.e. |
Now that we are adding more tests for the linalg extension, and we will soon have other extensions as well, we need to have a clean way for modules to not implement these extensions and not fail the test suite. Some test files mix extension and non-extension tests, e.g., the signature tests currently test all signatures.
This is closely related to #20.
The text was updated successfully, but these errors were encountered: