[Checkins] [zopefoundation/martian] cff083: Fix test incompatibility with zope.interface 5.0

Marius Gedminas noreply at github.com
Tue Apr 7 09:17:58 CEST 2020


  Branch: refs/heads/fix-readonly-module-attribute
  Home:   https://github.com/zopefoundation/martian
  Commit: cff083e506c4ab47765d850cca20989bbbbb8cfc
      https://github.com/zopefoundation/martian/commit/cff083e506c4ab47765d850cca20989bbbbb8cfc
  Author: Marius Gedminas <marius at gedmin.as>
  Date:   2020-04-07 (Tue, 07 Apr 2020)

  Changed paths:
    M src/martian/testing.py

  Log Message:
  -----------
  Fix test incompatibility with zope.interface 5.0

Recent zope.interface versions made Interface.__module__ a readonly
attribute.  Without this fix, tests fail on Python 2.7 with

    Traceback (most recent call last):
      File "/usr/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest directive.rst[105]>", line 1, in <module>
        class once_iface(FakeModule):
      File "/home/mg/src/zopefoundation/martian/src/martian/testing.py", line 65, in __init__
        fake_import(cls)
      File "/home/mg/src/zopefoundation/martian/src/martian/testing.py", line 33, in fake_import
        obj.__module__ = module.__name__
    TypeError: readonly attribute

(On Python 3 assignment to a readonly attribute raises an AttributeError
instead, which was already caught.)




More information about the checkins mailing list