#1474 closed defect (fixed)

test that classes declared to implement a zope interface actually implement it

Reported by: davidsarah Owned by: zooko
Priority: major Milestone: 1.9.0
Component: code Version: 1.8.2
Keywords: zope.interface test review-needed Cc:
Launchpad Bug:

Description

... using zope.interface.verify.verifyClass or verifyObject as described here.

Attachments (4)

zope-warnings.txt (8.5 KB) - added by davidsarah at 2011-08-25T01:12:29Z.
Results from enforcing interfaces
enforce-zope-interfaces.darcs.patch (60.6 KB) - added by davidsarah at 2011-08-25T01:25:37Z.
Enforce zope interfaces
check-interfaces.darcs.patch (65.6 KB) - added by davidsarah at 2011-09-15T16:19:24Z.
Add a script 'misc/coding_tools/check-interfaces.py' that checks whether zope interfaces are enforced. Also add 'check-interfaces', 'version-and-path', and 'code-checks' targets to the Makefile. fixes #1474
improve-check-interfaces.darcs.patch (76.9 KB) - added by davidsarah at 2011-09-16T22:37:21Z.
various improvements to check-interface.py

Download all attachments as: .zip

Change History (11)

Changed at 2011-08-25T01:12:29Z by davidsarah

Results from enforcing interfaces

Changed at 2011-08-25T01:25:37Z by davidsarah

Enforce zope interfaces

comment:1 Changed at 2011-08-26T21:48:41Z by davidsarah

The current patch isn't ready for review because it outputs warnings to stderr as classes are loaded. We probably want to collect the warnings and output them in a unit test, and we may want to do so only when running the test suite. The implementation is also a bit too dependent on semi-documented (that is, documented only in source code comments) parts of zope.interface.

Changed at 2011-09-15T16:19:24Z by davidsarah

Add a script 'misc/coding_tools/check-interfaces.py' that checks whether zope interfaces are enforced. Also add 'check-interfaces', 'version-and-path', and 'code-checks' targets to the Makefile. fixes #1474

comment:2 Changed at 2011-09-15T16:22:23Z by davidsarah

  • Keywords review-needed added
  • Milestone changed from undecided to 1.9.0
  • Owner changed from somebody to zooko

attachment:check-interfaces.darcs.patch is much less disruptive than the previous patch; it doesn't change the behaviour at runtime, only when check-interfaces.py is run (e.g. by 'make check-interfaces' or 'make code-checks').

Changed at 2011-09-16T22:37:21Z by davidsarah

various improvements to check-interface.py

comment:3 Changed at 2011-09-20T15:51:22Z by david-sarah@…

In 87a936564e393a2e:

uri.py: fix two interface violations in verifier URI classes. refs #1474

comment:4 Changed at 2011-09-24T21:32:40Z by david-sarah@…

  • Resolution set to fixed
  • Status changed from new to closed

In 417054aabad6cf4b:

Add a script 'misc/coding_tools/check-interfaces.py' that checks whether zope interfaces are enforced. Also add 'check-interfaces', 'version-and-path', and 'code-checks' targets to the Makefile. fixes #1474

comment:5 Changed at 2011-09-24T21:32:41Z by david-sarah@…

In f1445ce0b2c347b2:

misc/coding_tools/check-interfaces.py: reduce false-positives by adding Dummy* to the set of excluded classnames, and bench-* to the set of excluded basenames. refs #1474

comment:6 Changed at 2011-09-24T21:32:41Z by david-sarah@…

In 9ca8ff7bfce1a216:

misc/coding_tools/check_interfaces.py: use os.walk instead of FilePath?, since this script shouldn't really depend on Twisted. refs #1474

comment:7 Changed at 2011-09-24T21:32:41Z by david-sarah@…

In 32262239e5c21063:

misc/coding_tools/check_interfaces.py: report all violations rather than only one for a given class, by including a forked version of verifyClass. refs #1474

Note: See TracTickets for help on using tickets.