ports/devel/py-deprecation/patches/patch-tests_test_deprecation_py

43 lines
1.3 KiB
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
This port is python3 only, we do not need unittest2
Index: tests/test_deprecation.py
--- tests/test_deprecation.py.orig
+++ tests/test_deprecation.py
@@ -10,16 +10,14 @@
# License for the specific language governing permissions and limitations
# under the License.
-# As we unfortunately support Python 2.7, it lacks TestCase.subTest which
-# is in 3.4+ or in unittest2
-import unittest2
+import unittest
import warnings
import deprecation
from datetime import date
-class Test_deprecated(unittest2.TestCase):
+class Test_deprecated(unittest.TestCase):
def test_args_set_on_base_class(self):
args = (1, 2, 3, 4)
@@ -230,7 +228,7 @@ class Test_deprecated(unittest2.TestCase):
self.assertEqual(sot.method(), ret_val)
-class Test_fail_if_not_removed(unittest2.TestCase):
+class Test_fail_if_not_removed(unittest.TestCase):
@deprecation.deprecated(deprecated_in="1.0", current_version="2.0")
def _deprecated_method(self):
@@ -259,7 +257,7 @@ class Test_fail_if_not_removed(unittest2.TestCase):
except AssertionError:
self.fail("A DeprecatedWarning shouldn't cause a failure")
- @unittest2.expectedFailure
+ @unittest.expectedFailure
@deprecation.fail_if_not_removed
def test_literal_UnsupportedWarning(self):
self._unsupported_method()