Skip to content

Commit

Permalink
Add additional tests for assigning to Interface.__module__.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Mar 16, 2020
1 parent 52aa218 commit f5299f1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/zope/interface/tests/test_interface.py
Expand Up @@ -1053,6 +1053,13 @@ class ISpam(Interface):
ISpam.__class__ = MyInterfaceClass
self.assertEqual(ISpam(1), (1,))

def test__module__is_readonly(self):
inst = self._makeOne()
with self.assertRaises((AttributeError, TypeError)):
# CPython 2.7 raises TypeError. Everything else
# raises AttributeError.
inst.__module__ = 'different.module'


class InterfaceTests(unittest.TestCase):

Expand Down

0 comments on commit f5299f1

Please sign in to comment.