diff options
author | Michael Howitz <mh@gocept.com> | 2019-03-27 08:25:36 +0100 |
---|---|---|
committer | Michael Howitz <mh@gocept.com> | 2019-03-27 08:25:36 +0100 |
commit | b680e36a03789a8cfe2e7cb0ffc0388bb9518c77 (patch) | |
tree | 8a85c18658a2fb261311d30895123bf2997d0cd2 | |
parent | 28505883fb41c6692e2f9c0c07f375843eb1e8f4 (diff) | |
download | zope-tales-fix-deprecations.tar.gz |
Move BBB code out of public API.fix-deprecations
-rw-r--r-- | src/zope/tales/testing.py | 12 | ||||
-rw-r--r-- | src/zope/tales/tests/__init__.py | 13 | ||||
-rw-r--r-- | src/zope/tales/tests/test_expressions.py | 4 | ||||
-rw-r--r-- | src/zope/tales/tests/test_tales.py | 4 |
4 files changed, 15 insertions, 18 deletions
diff --git a/src/zope/tales/testing.py b/src/zope/tales/testing.py deleted file mode 100644 index 1bb3c4e..0000000 --- a/src/zope/tales/testing.py +++ /dev/null @@ -1,12 +0,0 @@ -import six -import unittest - - -class TestCase(unittest.TestCase): - """Base test case for Python version compatibility.""" - - if six.PY2: # pragma: no cover - # Avoid DeprecationWarning for assertRaisesRegexp on Python 3 while - # coping with Python 2 not having the Regex spelling variant - assertRaisesRegex = getattr(unittest.TestCase, 'assertRaisesRegex', - unittest.TestCase.assertRaisesRegexp) diff --git a/src/zope/tales/tests/__init__.py b/src/zope/tales/tests/__init__.py index b711d36..b8e0d1d 100644 --- a/src/zope/tales/tests/__init__.py +++ b/src/zope/tales/tests/__init__.py @@ -1,2 +1,11 @@ -# -# This file is necessary to make this directory a package. +import six +import unittest + + +class TestCase(unittest.TestCase): + """Base test case for Python version compatibility.""" + + if six.PY2: # pragma: PY2 + # Avoid DeprecationWarning for assertRaisesRegexp on Python 3 while + # coping with Python 2 not having the Regex spelling variant + assertRaisesRegex = unittest.TestCase.assertRaisesRegexp diff --git a/src/zope/tales/tests/test_expressions.py b/src/zope/tales/tests/test_expressions.py index 9699787..94f8ecf 100644 --- a/src/zope/tales/tests/test_expressions.py +++ b/src/zope/tales/tests/test_expressions.py @@ -21,7 +21,7 @@ from zope.tales.engine import Engine from zope.tales.interfaces import ITALESFunctionNamespace from zope.tales.tales import Undefined from zope.interface import implementer -import zope.tales.testing +import zope.tales.tests text_type = str if str is not bytes else unicode @@ -60,7 +60,7 @@ class OldStyleCallable: # NOT object pass -class ExpressionTestBase(zope.tales.testing.TestCase): +class ExpressionTestBase(zope.tales.tests.TestCase): def setUp(self): # Test expression compilation diff --git a/src/zope/tales/tests/test_tales.py b/src/zope/tales/tests/test_tales.py index 1ba6506..1781624 100644 --- a/src/zope/tales/tests/test_tales.py +++ b/src/zope/tales/tests/test_tales.py @@ -21,7 +21,7 @@ import six from zope.tales import tales from zope.tales.tests.simpleexpr import SimpleExpr from zope.testing import renormalizing -import zope.tales.testing +import zope.tales.tests class TestIterator(unittest.TestCase): @@ -150,7 +150,7 @@ class TALESTests(unittest.TestCase): ctxt.endScope() -class TestExpressionEngine(zope.tales.testing.TestCase): +class TestExpressionEngine(zope.tales.tests.TestCase): def setUp(self): self.engine = tales.ExpressionEngine() |