Skip to content

Commit

Permalink
Fix PURE_PYTHON tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Aug 2, 2021
1 parent a16fed4 commit 6653a2d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/nti/externalization/tests/test_datastructures.py
Expand Up @@ -770,6 +770,7 @@ def test_provides(self):
def test_subclass(self):
from nti.externalization.interfaces import IInternalObjectExternalizer
from nti.externalization.datastructures import StandardInternalObjectExternalizer
from nti.externalization._compat import PURE_PYTHON

class X(StandardInternalObjectExternalizer):
def __init__(self, context):
Expand All @@ -791,10 +792,13 @@ class Ext(object):
# Now non-native-strs
ext = Ext()
ext.creator = u'sjohnson'
with self.assertRaises(TypeError):
o.__external_class_name__ = u'Foo' if bytes is str else b'Foo'
o.context = ext

if not PURE_PYTHON:
# XXX: pure-python mode allows anything.
with self.assertRaises(TypeError):
o.__external_class_name__ = u'Foo' if bytes is str else b'Foo'

ext = o.toExternalObject()
assert_that(ext, is_({
'Class': 'Foo',
Expand Down

0 comments on commit 6653a2d

Please sign in to comment.