diff -ru testtools-2.4.0-orig/requirements.txt testtools-2.4.0/requirements.txt
--- testtools-2.4.0-orig/requirements.txt 2018-04-04 16:27:14.000000000 -0700
+++ testtools-2.4.0/requirements.txt 2020-04-03 17:03:31.776205598 -0700
@@ -4,6 +4,4 @@
# 'mimeparse' has not been uploaded by the maintainer with Python3 compat
# but someone kindly uploaded a fixed version as 'python-mimeparse'.
python-mimeparse
-unittest2>=1.0.0
-traceback2
six>=1.4.0
diff -ru testtools-2.4.0-orig/setup.cfg testtools-2.4.0/setup.cfg
--- testtools-2.4.0-orig/setup.cfg 2020-03-14 07:30:56.000000000 -0700
+++ testtools-2.4.0/setup.cfg 2020-04-03 17:04:37.605592118 -0700
@@ -28,7 +28,6 @@
test =
testscenarios
testresources
- unittest2>=1.1.0
[files]
packages = testtools
diff -ru testtools-2.4.0-orig/testtools/compat.py testtools-2.4.0/testtools/compat.py
--- testtools-2.4.0-orig/testtools/compat.py 2018-04-04 16:27:14.000000000 -0700
+++ testtools-2.4.0/testtools/compat.py 2020-04-03 17:02:34.047743583 -0700
@@ -33,10 +33,7 @@
# To let setup.py work, make this a conditional import.
linecache = try_import('linecache2')
-try:
- from testtools import _compat2x as _compat
-except SyntaxError:
- from testtools import _compat3x as _compat
+from testtools import _compat3x as _compat
reraise = _compat.reraise
diff -ru testtools-2.4.0-orig/testtools/content.py testtools-2.4.0/testtools/content.py
--- testtools-2.4.0-orig/testtools/content.py 2018-04-04 16:27:14.000000000 -0700
+++ testtools-2.4.0/testtools/content.py 2020-04-03 17:05:23.037168731 -0700
@@ -17,10 +17,9 @@
import json
import os
import sys
+import traceback
from extras import try_import
-# To let setup.py work, make this a conditional import.
-traceback = try_import('traceback2')
from testtools.compat import (
_b,
diff -ru testtools-2.4.0-orig/testtools/run.py testtools-2.4.0/testtools/run.py
--- testtools-2.4.0-orig/testtools/run.py 2015-11-07 09:27:33.000000000 -0800
+++ testtools-2.4.0/testtools/run.py 2020-04-03 17:07:07.353196586 -0700
@@ -12,11 +12,9 @@
from functools import partial
import os.path
import sys
+import unittest
from extras import safe_hasattr, try_imports
-# To let setup.py work, make this a conditional import.
-unittest = try_imports(['unittest2', 'unittest'])
-
from testtools import TextTestResult, testcase
from testtools.compat import classtypes, istext, unicode_output_stream
from testtools.testsuite import filter_by_ids, iterate_tests, sorted_tests
@@ -50,7 +48,6 @@
describing things that failed to import.
"""
unittest_import_strs = set([
- 'unittest2.loader.ModuleImportFailure.',
'unittest.loader.ModuleImportFailure.',
'discover.ModuleImportFailure.'
])
diff -ru testtools-2.4.0-orig/testtools/testcase.py testtools-2.4.0/testtools/testcase.py
--- testtools-2.4.0-orig/testtools/testcase.py 2019-11-28 00:58:29.000000000 -0800
+++ testtools-2.4.0/testtools/testcase.py 2020-04-03 17:27:49.122395535 -0700
@@ -19,22 +19,15 @@
import copy
import functools
import itertools
+import six
import sys
+import unittest
import warnings
from extras import (
safe_hasattr,
try_import,
)
-# To let setup.py work, make this a conditional import.
-# Don't use extras.try_imports, as it interferes with PyCharm's unittest
-# detection algorithm. See: https://youtrack.jetbrains.com/issue/PY-26630
-try:
- import unittest2 as unittest
-except ImportError:
- import unittest
-import six
-
from testtools import (
content,
)
@@ -66,23 +59,8 @@
wraps = try_import('functools.wraps')
-
-class TestSkipped(Exception):
- """Raised within TestCase.run() when a test is skipped."""
-TestSkipped = try_import('unittest.case.SkipTest', TestSkipped)
-TestSkipped = try_import('unittest2.case.SkipTest', TestSkipped)
-
-
-class _UnexpectedSuccess(Exception):
- """An unexpected success was raised.
-
- Note that this exception is private plumbing in testtools' testcase
- module.
- """
-_UnexpectedSuccess = try_import(
- 'unittest.case._UnexpectedSuccess', _UnexpectedSuccess)
-_UnexpectedSuccess = try_import(
- 'unittest2.case._UnexpectedSuccess', _UnexpectedSuccess)
+from unittest.case import SkipTest as TestSkipped
+from unittest.case import _UnexpectedSuccess
class _ExpectedFailure(Exception):
@@ -93,8 +71,6 @@
"""
_ExpectedFailure = try_import(
'unittest.case._ExpectedFailure', _ExpectedFailure)
-_ExpectedFailure = try_import(
- 'unittest2.case._ExpectedFailure', _ExpectedFailure)
# Copied from unittest before python 3.4 release. Used to maintain
diff -ru testtools-2.4.0-orig/testtools/tests/test_compat.py testtools-2.4.0/testtools/tests/test_compat.py
--- testtools-2.4.0-orig/testtools/tests/test_compat.py 2019-11-28 00:58:29.000000000 -0800
+++ testtools-2.4.0/testtools/tests/test_compat.py 2020-04-03 17:11:59.211436348 -0700
@@ -4,7 +4,7 @@
import ast
import io
-import linecache2 as linecache
+import linecache
import os
import sys
import tempfile
diff -ru testtools-2.4.0-orig/testtools/tests/test_run.py testtools-2.4.0/testtools/tests/test_run.py
--- testtools-2.4.0-orig/testtools/tests/test_run.py 2015-11-07 09:27:33.000000000 -0800
+++ testtools-2.4.0/testtools/tests/test_run.py 2020-04-03 17:30:21.725938899 -0700
@@ -10,7 +10,7 @@
from extras import try_import
fixtures = try_import('fixtures')
testresources = try_import('testresources')
-import unittest2
+import unittest
import testtools
from testtools import TestCase, run, skipUnless
@@ -195,13 +195,13 @@
broken = self.useFixture(SampleTestFixture(broken=True))
out = StringIO()
# XXX: http://bugs.python.org/issue22811
- unittest2.defaultTestLoader._top_level_dir = None
+ unittest.defaultTestLoader._top_level_dir = None
exc = self.assertRaises(
SystemExit,
run.main, ['prog', 'discover', '-l', broken.package.base, '*.py'], out)
self.assertEqual(2, exc.args[0])
self.assertThat(out.getvalue(), DocTestMatches("""\
-unittest2.loader._FailedTest.runexample
+unittest.loader._FailedTest.runexample
Failed to import test module: runexample
Traceback (most recent call last):
File ".../loader.py", line ..., in _find_test_path
@@ -345,7 +345,7 @@
pkg = self.useFixture(SampleLoadTestsPackage())
out = StringIO()
# XXX: http://bugs.python.org/issue22811
- unittest2.defaultTestLoader._top_level_dir = None
+ unittest.defaultTestLoader._top_level_dir = None
self.assertEqual(None, run.main(
['prog', 'discover', '-l', pkg.package.base], out))
self.assertEqual(dedent("""\
diff -ru testtools-2.4.0-orig/testtools/tests/test_testsuite.py testtools-2.4.0/testtools/tests/test_testsuite.py
--- testtools-2.4.0-orig/testtools/tests/test_testsuite.py 2018-04-04 16:27:14.000000000 -0700
+++ testtools-2.4.0/testtools/tests/test_testsuite.py 2020-04-03 17:13:27.006601122 -0700
@@ -5,7 +5,6 @@
import doctest
from pprint import pformat
import unittest
-import unittest2
from extras import try_import
@@ -223,9 +222,9 @@
raise cls.skipException('foo')
def test_notrun(self):
pass
- # Test discovery uses the default suite from unittest2 (unless users
+ # Test discovery uses the default suite from unittest (unless users
# deliberately change things, in which case they keep both pieces).
- suite = unittest2.TestSuite([Skips("test_notrun")])
+ suite = unittest.TestSuite([Skips("test_notrun")])
log = []
result = LoggingResult(log)
suite.run(result)
@@ -240,9 +239,9 @@
super(Simples, cls).setUpClass()
def test_simple(self):
pass
- # Test discovery uses the default suite from unittest2 (unless users
+ # Test discovery uses the default suite from unittest (unless users
# deliberately change things, in which case they keep both pieces).
- suite = unittest2.TestSuite([Simples("test_simple")])
+ suite = unittest.TestSuite([Simples("test_simple")])
log = []
result = LoggingResult(log)
suite.run(result)
diff -ru testtools-2.4.0-orig/testtools/tests/twistedsupport/test_deferred.py testtools-2.4.0/testtools/tests/twistedsupport/test_deferred.py
--- testtools-2.4.0-orig/testtools/tests/twistedsupport/test_deferred.py 2018-04-04 16:27:14.000000000 -0700
+++ testtools-2.4.0/testtools/tests/twistedsupport/test_deferred.py 2020-04-03 17:13:45.124428761 -0700
@@ -52,5 +52,5 @@
def test_suite():
- from unittest2 import TestLoader, TestSuite
+ from unittest import TestLoader, TestSuite
return TestLoader().loadTestsFromName(__name__)
diff -ru testtools-2.4.0-orig/testtools/tests/twistedsupport/test_matchers.py testtools-2.4.0/testtools/tests/twistedsupport/test_matchers.py
--- testtools-2.4.0-orig/testtools/tests/twistedsupport/test_matchers.py 2018-04-04 16:27:14.000000000 -0700
+++ testtools-2.4.0/testtools/tests/twistedsupport/test_matchers.py 2020-04-03 17:13:58.452301968 -0700
@@ -205,5 +205,5 @@
def test_suite():
- from unittest2 import TestLoader, TestSuite
+ from unittest import TestLoader, TestSuite
return TestLoader().loadTestsFromName(__name__)
diff -ru testtools-2.4.0-orig/testtools/tests/twistedsupport/test_runtest.py testtools-2.4.0/testtools/tests/twistedsupport/test_runtest.py
--- testtools-2.4.0-orig/testtools/tests/twistedsupport/test_runtest.py 2018-04-04 16:27:14.000000000 -0700
+++ testtools-2.4.0/testtools/tests/twistedsupport/test_runtest.py 2020-04-03 17:14:09.153200167 -0700
@@ -1016,7 +1016,7 @@
def test_suite():
- from unittest2 import TestLoader, TestSuite
+ from unittest import TestLoader, TestSuite
return TestLoader().loadTestsFromName(__name__)
diff -ru testtools-2.4.0-orig/testtools/testsuite.py testtools-2.4.0/testtools/testsuite.py
--- testtools-2.4.0-orig/testtools/testsuite.py 2018-04-04 16:27:14.000000000 -0700
+++ testtools-2.4.0/testtools/testsuite.py 2020-04-03 17:02:34.047743583 -0700
@@ -17,8 +17,6 @@
import unittest
from extras import safe_hasattr, try_imports
-# This is just to let setup.py work, as testtools is imported in setup.py.
-unittest2 = try_imports(['unittest2', 'unittest'])
Queue = try_imports(['Queue.Queue', 'queue.Queue'])
import testtools
@@ -36,7 +34,7 @@
yield subtest
-class ConcurrentTestSuite(unittest2.TestSuite):
+class ConcurrentTestSuite(unittest.TestSuite):
"""A TestSuite whose run() calls out to a concurrency strategy."""
def __init__(self, suite, make_tests, wrap_result=None):
@@ -199,7 +197,7 @@
process_result.stopTestRun()
-class FixtureSuite(unittest2.TestSuite):
+class FixtureSuite(unittest.TestSuite):
def __init__(self, fixture, tests):
super(FixtureSuite, self).__init__(tests)
diff -ru testtools-2.4.0-orig/testtools.egg-info/requires.txt testtools-2.4.0/testtools.egg-info/requires.txt
--- testtools-2.4.0-orig/testtools.egg-info/requires.txt 2020-03-14 07:30:56.000000000 -0700
+++ testtools-2.4.0/testtools.egg-info/requires.txt 2020-04-03 17:31:06.316513271 -0700
@@ -3,10 +3,7 @@
pbr>=0.11
python-mimeparse
six>=1.4.0
-traceback2
-unittest2>=1.0.0
[test]
testresources
testscenarios
-unittest2>=1.1.0