Skip to content
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

Misc testing fixes #1021

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Oct 7, 2024

This PR does a bunch of minor cleanups on the testing suite:

  • Execute minimal rewrites in PyTorch and JAX backends (Numba already did it), so that we are sure to test the Op implementations.
    • Sometimes tests were defined with constant inputs and due to constant folding who ended up never testing the backend implementation.
  • Fix incorrect configuration of pytest in pyproject.toml
  • Make xfail strict (test fails if marked as xfail but actually passed)

📚 Documentation preview 📚: https://pytensor--1021.org.readthedocs.build/en/1021/

@@ -78,7 +78,7 @@ jobs:
install-jax: [0]
install-torch: [0]
part:
- "--doctest-modules --ignore=pytensor/misc/check_duplicate_key.py pytensor --ignore=pytensor/link"
- "--doctest-modules pytensor --ignore=pytensor/misc/check_duplicate_key.py --ignore=pytensor/link"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just odd to have pytensor in the middle of the ignore files

@ricardoV94 ricardoV94 force-pushed the xfail_strict branch 2 times, most recently from 77fffef to f3e8575 Compare October 8, 2024 10:20
@ricardoV94 ricardoV94 changed the title Make xfail strict Misc testing fixes Oct 8, 2024
testpaths = "tests/"
[tool.pytest.ini_options]
addopts = "--durations=50 --doctest-modules --ignore=pytensor/link --ignore=pytensor/misc/check_duplicate_key.py"
testpaths = ["pytensor/", "tests/"]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pytensor is in the testpath because of --doctest-modules, so we test the code examples in the docstrings by default

Only run required rewrites in JAX tests

Several tests ended up not testing the JAX implementation due to constant folding of inputs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant