-
Notifications
You must be signed in to change notification settings - Fork 188
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 official support for Python 3.10 and 3.11 #288
base: master
Are you sure you want to change the base?
Conversation
Looks like Python 3.5 & 3.6 are no longer available on latest
The former is no longer maintained and has some known issues with Python 3.9+
@@ -7,10 +7,11 @@ on: [push, pull_request] | |||
|
|||
jobs: | |||
build: | |||
runs-on: ubuntu-latest | |||
runs-on: ubuntu-20.04 |
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.
It's no longer possible to install Python 3.5 and 3.6 on ubuntu-latest which now points to 22.04. They are both EOL so it's probably time to drop support for them, but that feels out of scope of this change.
def ok_(expr, msg=None): | ||
""" | ||
Shorthand for assert. | ||
|
||
Copied from Nose. | ||
""" | ||
if not expr: | ||
raise AssertionError(msg) | ||
|
||
|
||
def eq_(a, b, msg=None): | ||
""" | ||
Shorthand for 'assert a == b, "%r != %r" % (a, b). | ||
|
||
Copied from Nose. | ||
""" | ||
if not a == b: | ||
raise AssertionError(msg or "%r != %r" % (a, b)) | ||
|
||
|
||
def assert_raises(exc_class, func, *args): | ||
"""Compatibility with Nose API for pytest.""" | ||
with pytest.raises(exc_class): | ||
func(*args) |
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.
These provide compatibility with Nose APIs. I can replace their usage in this file with direct pytest equivalent if you prefer.
The main blocker were the test runner, nose which is no longer maintained and has several open issues for recent versions of Python:
I've replaced nose test runner by pytest (which is widely used in the Python community), let me know if you disagree with this choice, and if you prefer another alternative.
Related: #265