diff options
| author | Michael Merickel <michael@merickel.org> | 2018-10-31 01:36:26 -0500 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2018-11-12 21:39:23 -0600 |
| commit | 6b0e4625da2c53a1e3fdb4857fc7c6ba6ce562cf (patch) | |
| tree | 5d115273784eb021e5550539e39f552672921329 /tests/test_util.py | |
| parent | 7429fcb5a96aa10bbe86da08bd0b30c9292efdde (diff) | |
| download | pyramid-6b0e4625da2c53a1e3fdb4857fc7c6ba6ce562cf.tar.gz pyramid-6b0e4625da2c53a1e3fdb4857fc7c6ba6ce562cf.tar.bz2 pyramid-6b0e4625da2c53a1e3fdb4857fc7c6ba6ce562cf.zip | |
initial work to remove py2 from the codebase
Diffstat (limited to 'tests/test_util.py')
| -rw-r--r-- | tests/test_util.py | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/tests/test_util.py b/tests/test_util.py index a36655f6f..8af5fe557 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -1,5 +1,5 @@ import unittest -from pyramid.compat import PY2, text_, bytes_ +from pyramid.compat import text_, bytes_ class Test_InstancePropertyHelper(unittest.TestCase): @@ -170,14 +170,10 @@ class Test_InstancePropertyHelper(unittest.TestCase): self.assertEqual(2, foo.y) def test_make_property_unicode(self): - from pyramid.compat import text_ from pyramid.exceptions import ConfigurationError cls = self._getTargetClass() - if PY2: - name = text_(b'La Pe\xc3\xb1a', 'utf-8') - else: - name = b'La Pe\xc3\xb1a' + name = b'La Pe\xc3\xb1a' def make_bad_name(): cls.make_property(lambda x: 1, name=name, reify=True) @@ -498,10 +494,7 @@ class Test_object_description(unittest.TestCase): self.assertEqual(self._callFUT(('a', 'b')), "('a', 'b')") def test_set(self): - if PY2: - self.assertEqual(self._callFUT(set(['a'])), "set(['a'])") - else: - self.assertEqual(self._callFUT(set(['a'])), "{'a'}") + self.assertEqual(self._callFUT(set(['a'])), "{'a'}") def test_list(self): self.assertEqual(self._callFUT(['a']), "['a']") @@ -841,26 +834,16 @@ class TestSentinel(unittest.TestCase): class TestCallableName(unittest.TestCase): def test_valid_ascii(self): from pyramid.util import get_callable_name - from pyramid.compat import text_ - - if PY2: - name = text_(b'hello world', 'utf-8') - else: - name = b'hello world' + name = b'hello world' self.assertEqual(get_callable_name(name), 'hello world') def test_invalid_ascii(self): from pyramid.util import get_callable_name - from pyramid.compat import text_ from pyramid.exceptions import ConfigurationError def get_bad_name(): - if PY2: - name = text_(b'La Pe\xc3\xb1a', 'utf-8') - else: - name = b'La Pe\xc3\xb1a' - + name = b'La Pe\xc3\xb1a' get_callable_name(name) self.assertRaises(ConfigurationError, get_bad_name) |
