-
Notifications
You must be signed in to change notification settings - Fork 186
Add official support for Python 3.10 and 3.11 #288
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
base: master
Are you sure you want to change the base?
Changes from all commits
831b600
d8b5d28
1df8858
afed2d5
b87fe42
84d016d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,15 +3,15 @@ | |
| import sys | ||
| import os | ||
| import unittest | ||
| import tempfile | ||
| from contextlib import contextmanager | ||
| from io import StringIO | ||
| import tempfile | ||
| from unittest import mock | ||
|
|
||
| import pytest | ||
| from lxml.etree import XMLSyntaxError, fromstring | ||
| from requests.exceptions import HTTPError | ||
| import mock | ||
| import premailer.premailer # lint:ok | ||
| from nose.tools import assert_raises, eq_, ok_ | ||
| from premailer.__main__ import main | ||
| from premailer.premailer import ( | ||
| ExternalNotFoundError, | ||
|
|
@@ -23,6 +23,32 @@ | |
| ) | ||
|
|
||
|
|
||
| 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) | ||
|
Comment on lines
+26
to
+49
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
A search-and-replace is probably better. |
||
|
|
||
|
|
||
| whitespace_between_tags = re.compile(r">\s*<") | ||
|
|
||
|
|
||
|
|
||
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.