diff options
| author | Jason Madden <jamadden@gmail.com> | 2020-03-16 09:10:46 -0500 |
|---|---|---|
| committer | Jason Madden <jamadden@gmail.com> | 2020-03-18 12:29:51 -0500 |
| commit | 6be183e34defe640bbad3d898fa3468bf292438a (patch) | |
| tree | 3093058f9d43322e37e52e7a2a36d674a58f5c45 | |
| parent | a2687a64253c76b0d7452d102f521e7f680b5306 (diff) | |
| download | zope-interface-6be183e34defe640bbad3d898fa3468bf292438a.tar.gz | |
Add additional tests for assigning to Interface.__module__.
| -rw-r--r-- | CHANGES.rst | 6 | ||||
| -rw-r--r-- | src/zope/interface/tests/test_interface.py | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/CHANGES.rst b/CHANGES.rst index 80c5c48..9ba0d8b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -158,18 +158,12 @@ - Fix a potential interpreter crash in the low-level adapter registry lookup functions. See issue 11. -<<<<<<< HEAD - Adopt Python's standard `C3 resolution order <https://www.python.org/download/releases/2.3/mro/>`_ to compute the ``__iro__`` and ``__sro__`` of interfaces, with tweaks to support additional cases that are common in interfaces but disallowed for Python classes. Previously, an ad-hoc ordering that made no particular guarantees was used. -======= -- Use Python's standard C3 resolution order to compute the - ``__iro__`` and ``__sro__`` of interfaces. Previously, an ad-hoc - ordering that made no particular guarantees was used. ->>>>>>> Add tests for comparing InterfaceClass/Implements objects to things without the required attributes. This has many beneficial properties, including the fact that base interface and base classes tend to appear near the end of the diff --git a/src/zope/interface/tests/test_interface.py b/src/zope/interface/tests/test_interface.py index be3323d..7b7b7e8 100644 --- a/src/zope/interface/tests/test_interface.py +++ b/src/zope/interface/tests/test_interface.py @@ -1121,6 +1121,13 @@ class InterfaceClassTests(unittest.TestCase): 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): |
