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

Closed
opened 2011-08-10 01:06:06 +00:00 by davidsarah · 11 comments
davidsarah commented 2011-08-10 01:06:06 +00:00
Owner

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

... using `zope.interface.verify.verifyClass` or `verifyObject` as described [here](http://stackoverflow.com/questions/2521189/purpose-of-zope-interfaces).
tahoe-lafs added the
code
major
defect
1.8.2
labels 2011-08-10 01:06:06 +00:00
tahoe-lafs added this to the undecided milestone 2011-08-10 01:06:06 +00:00
davidsarah commented 2011-08-25 01:12:29 +00:00
Author
Owner

Attachment zope-warnings.txt (8705 bytes) added

Results from enforcing interfaces

**Attachment** zope-warnings.txt (8705 bytes) added Results from enforcing interfaces
davidsarah commented 2011-08-25 01:25:37 +00:00
Author
Owner

Attachment enforce-zope-interfaces.darcs.patch (62024 bytes) added

Enforce zope interfaces

**Attachment** enforce-zope-interfaces.darcs.patch (62024 bytes) added Enforce zope interfaces
davidsarah commented 2011-08-26 21:48:41 +00:00
Author
Owner

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.

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.
davidsarah commented 2011-09-15 16:19:24 +00:00
Author
Owner

Attachment check-interfaces.darcs.patch (67127 bytes) added

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

**Attachment** check-interfaces.darcs.patch (67127 bytes) added 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
davidsarah commented 2011-09-15 16:22:23 +00:00
Author
Owner

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').

[check-interfaces.darcs.patch](/tahoe-lafs/trac-2024-07-25/attachments/000078ac-fcd8-b5b9-ecb8-9ce0957fdb73) 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`').
tahoe-lafs modified the milestone from undecided to 1.9.0 2011-09-15 16:22:23 +00:00
davidsarah commented 2011-09-16 22:37:21 +00:00
Author
Owner

Attachment improve-check-interfaces.darcs.patch (78759 bytes) added

various improvements to check-interface.py

**Attachment** improve-check-interfaces.darcs.patch (78759 bytes) added various improvements to check-interface.py
david-sarah@jacaranda.org commented 2011-09-20 15:51:22 +00:00
Author
Owner

In changeset:87a936564e393a2e:

uri.py: fix two interface violations in verifier URI classes. refs #1474
In changeset:87a936564e393a2e: ``` uri.py: fix two interface violations in verifier URI classes. refs #1474 ```
david-sarah@jacaranda.org commented 2011-09-24 21:32:40 +00:00
Author
Owner

In changeset: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
In changeset: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 ```
tahoe-lafs added the
fixed
label 2011-09-24 21:32:40 +00:00
david-sarah@jacaranda.org commented 2011-09-24 21:32:41 +00:00
Author
Owner

In changeset: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
In changeset: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 ```
david-sarah@jacaranda.org commented 2011-09-24 21:32:41 +00:00
Author
Owner

In changeset:9ca8ff7bfce1a216:

misc/coding_tools/check_interfaces.py: use os.walk instead of FilePath, since this script shouldn't really depend on Twisted. refs #1474
In changeset:9ca8ff7bfce1a216: ``` misc/coding_tools/check_interfaces.py: use os.walk instead of FilePath, since this script shouldn't really depend on Twisted. refs #1474 ```
david-sarah@jacaranda.org commented 2011-09-24 21:32:41 +00:00
Author
Owner

In changeset: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
In changeset: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 ```
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: tahoe-lafs/trac-2024-07-25#1474
No description provided.