Группа :: Development/Python3
Пакет: python3-module-premailer
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: premailer-3.10.0-alt-nose-fix.patch
Скачать
Скачать
--- premailer/tests/test_premailer.py.orig 2023-04-11 08:05:07.294932647 +0000
+++ premailer/tests/test_premailer.py 2023-04-11 08:13:03.449431488 +0000
@@ -7,11 +7,11 @@ from contextlib import contextmanager
from io import StringIO
import tempfile
+import pytest
from lxml.etree import XMLSyntaxError, fromstring
from requests.exceptions import HTTPError
-import mock
+from unittest 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,30 @@ from premailer.premailer import (
)
+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)
+
+
whitespace_between_tags = re.compile(r">\s*<")
--- setup.py.orig 2023-04-11 08:05:07.294932647 +0000
+++ setup.py 2023-04-11 08:14:14.122054543 +0000
@@ -20,7 +20,7 @@ def find_version(*file_paths):
install_requires = ["lxml", "cssselect", "cssutils", "requests", "cachetools"]
-tests_require = ["nose", "mock"]
+tests_require = ["pytest", "pytest-cov"]
setup(
name="premailer",
--- tox.ini.orig 2023-04-11 08:05:07.294932647 +0000
+++ tox.ini 2023-04-11 08:16:50.148205770 +0000
@@ -6,6 +6,8 @@ envlist =
py37,
py38,
py39,
+ py310,
+ py311,
pypy3,
[gh-actions]
@@ -24,7 +26,7 @@ install_command =
extras =
test
commands =
- nosetests --with-coverage --cover-package=premailer
+ pytest --cov=premailer
[testenv:lint-py39]
extras = dev