Rename module-global test methods#39208
Conversation
Pytest automatically identifies and runs all methods prefixed with `test_`, following the standard convention for denoting tests. In the Sage codebase, there are numerous methods with the `test_` prefix. While many of these are indeed intended for testing purposes, they do not conform to Pytest's requirements for valid tests. To address this, we are temporarily renaming these methods, with the goal of eventually converting them into proper Pytest tests in the future.
|
Documentation preview for this PR (built with commit 7939443; changes) is ready! 🎉 |
|
How about pytest.mark.skip? This risks being a breaking change. |
That might work as well, but then they would show up as "skipped tests" in pytest - which is also not really nice. |
|
I just come across a solution that doesn't involve changing the name https://stackoverflow.com/a/71164113 (though not sure if it's worth) |
Thanks! If someone dislikes the renames here, this would indeed be a nice workaround. |
|
that's fine with me |
Pytest automatically identifies and runs all methods prefixed with
test_, following the standard convention for denoting tests. In the Sage codebase, there are numerous methods with thetest_prefix. While many of these are indeed intended for testing purposes, they do not conform to Pytest's requirements for valid tests. To address this, we are temporarily renaming these methods, with the goal of eventually converting them into proper Pytest tests in the future.📝 Checklist
⌛ Dependencies