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
Add support for PEP695 TypeAliasType #11140
base: master
Are you sure you want to change the base?
Conversation
Kind of unhappy with the amount of hoopsI jump through to not let coverage/pytest really see the test code, as it is a true SyntaxError in all python Version before 3.12. Maybe there is a better idea? |
if sys.version_info < (3, 12): | ||
collect_ignore_glob = ["*_py312.py"] |
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.
Shall we add that to the previous versions too?
needs_py312 = pytest.mark.skipif( | ||
sys.version_info < (3, 12), reason="requires python3.12+" | ||
) |
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.
Tbh I would prefer adding that as a custom mark:
In conftest.py
:
import sys
def pytest_runtest_setup(item):
for mark in item.iter_markers():
if mark.name == 'py312' and sys.version_info < (3, 12):
pytest.skip("Cannot run on python versin < 3.12")
...
This would change the test code to:
import pytest
@pytest.mark.py312
def test_only_executed_on_python_312_and_above():
assert sys.version_info >= (3, 12)
Fixes: #10719
Discussed (by others) in: #10662
Adds support for PEP695.
Sidesupport (please check if intended!): Only loads
*_py312
files for python3.12 and later, as only the test introduces syntax not compatible for python < 3.12.Using
DependedVariable
in route dependencies will now work :).