Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
openSUSE:Factory:Rebuild
python-python-afl
remove-nose.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File remove-nose.patch of Package python-python-afl
Index: python-afl-0.7.3/tests/tools.py =================================================================== --- python-afl-0.7.3.orig/tests/tools.py +++ python-afl-0.7.3/tests/tools.py @@ -31,29 +31,20 @@ import tempfile import traceback import warnings -import nose.tools +from unittest import SkipTest -from nose import SkipTest +def assert_equal(first, second): + assert first == second -from nose.tools import ( - assert_equal, - assert_not_equal, - assert_true, -) +def assert_not_equal(first, second): + assert first != second + +def assert_true(first, msg): + assert first is True, msg def assert_fail(msg): assert_true(False, msg=msg) # pylint: disable=redundant-unittest-assert -def noseimport(vmaj, vmin, name=None): - def wrapper(f): - if f.__module__ == 'unittest.case': - return f - if sys.version_info >= (vmaj, vmin): - return getattr(nose.tools, name or f.__name__) - return f - return wrapper - -@noseimport(2, 7) class assert_raises(object): def __init__(self, exc_type): self._exc_type = exc_type @@ -76,28 +67,19 @@ class assert_raises(object): self.exception = exc_value return True -@noseimport(2, 7, 'assert_raises_regexp') -@noseimport(3, 2) @contextlib.contextmanager def assert_raises_regex(exc_type, regex): with assert_raises(exc_type) as ecm: yield assert_regex(str(ecm.exception), regex) -@noseimport(2, 7, 'assert_regexp_matches') -@noseimport(3, 2) def assert_regex(text, regex): - try: - str_types = basestring - except NameError: - str_types = (str, bytes) - if isinstance(regex, str_types): + if isinstance(regex, (str, bytes)): regex = re.compile(regex) if not regex.search(text): message = "Regex didn't match: {0!r} not found in {1!r}".format(regex.pattern, text) assert_fail(msg=message) -@noseimport(3, 2) @contextlib.contextmanager def assert_warns_regex(exc_type, regex): with warnings.catch_warnings(record=True) as wlog:
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor