Skip to content

Conversation

@browniebroke
Copy link

@browniebroke browniebroke commented Dec 20, 2022

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

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+
jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
Copy link
Author

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.

Comment on lines +26 to +49
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)
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant