| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
Fixes #171.
|
| |
|
|
| |
Also tweak documentation to DRY for verifyObject/verifyClass.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Eliminate the trailing newlines and blank spaces (the code called them
"a stupid artifact").
Include the name of the defining interface (so the user can easily look up
any requirements on the attribute) and, for methods, the expected
signature (no more guessing about how many arguments are required!).
This is implemented by giving Attribute and Method useful reprs and strs.
Previously, they just had the defaults.
Fixes #170
|
| |
|
|
|
|
|
|
|
| |
on Pypy
On PyPy2, they are ignored (like on CPython), but on PyPy3 they can
actually be validated.
Fixes #118
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #153
The items that went in each ``__all__`` are based on what is
documented:
$ rg --no-filename 'import' docs/ -trst | tr -s "[:blank:]" | sort | uniq | grep zope
>>> from pprint import pprint
>>> from zope.interface import *
>>> from zope.interface import Interface
>>> from zope.interface import Interface, Attribute, implementer
>>> from zope.interface import alsoProvides
>>> from zope.interface import classImplements
>>> from zope.interface import classImplementsOnly
>>> from zope.interface import directlyProvidedBy
>>> from zope.interface import directlyProvides
>>> from zope.interface import implementedBy
>>> from zope.interface import implementer
>>> from zope.interface import implementer_only
>>> from zope.interface import noLongerProvides
>>> from zope.interface import providedBy
>>> from zope.interface import provider
>>> from zope.interface.adapter import AdapterRegistry
>>> from zope.interface.declarations import Declaration
>>> from zope.interface.declarations import InstanceDeclarations
>>> from zope.interface.declarations import ProvidesClass
>>> from zope.interface.declarations import named
>>> from zope.interface.exceptions import BrokenImplementation
>>> from zope.interface.exceptions import Invalid
>>> from zope.interface.interface import Specification
>>> from zope.interface.interface import adapter_hooks
>>> from zope.interface.verify import verifyObject
>>> import gc
>>> import zope.interface
And also some personal judgement about what the public API is that I'm
more than happy to have reviewed.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
Turns out they can be called in some very strange error cases. See #162 and #163 for details.
This should fix #162 (at least the provided test case, five.intid, passes now).
It also does enough work on #163 that (a) the test can be written and run in pure-python mode, which was needed to debug it and (b) five.intid runs in pure-python mode (well, with a bunch of other small hacks to Acquisition, ExtensionClass, DocumentTemplate and AccessControl), but I won't claim that it fully fixes #163. For one thing, there are no specific tests. For another, I see more such differences.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Fixes #158
|
| |
|
|
| |
Fixes #157
|
| | |
|
| |
|
|
| |
another few percent.
|
| |
|
|
|
|
| |
example), so avoid allocating a WeakKeyDictionary until needed.
This saves another 2% or so.
|
| |
|
|
| |
In a test of 6000 modules that load 2245 InterfaceClass objects and produce 2233 ClassProvides instances, this saves about 1% total memory usage in Python 2.7.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Instead of storing 1 and 2 attributes, respectively, in __dict__. This lets us eliminate inst_attr and its use of an undocumented API.
It also helps reign in the size of these objects. Before, on CPython 8, a ClassProvides object that subclasses both SpecificationBase and ClassProvidesBase required 408 bytes: 48 for the object, 360 for the dict.
Now it requires 72 + 232 = 304.
With a bit of work on defining __slots__ in Python, that can be brought much lower still, I think.
zope.security tests pass with this installed.
|
| |
|
|
| |
Also add a line of missing whitespace.
|
| |
|
|
| |
And tox. It wasn't properly working to report coverage before.
|
| |
|
|
|
|
|
| |
Turns out that the C extensions build and work fine with PyPy, but don't use them by default. Let them
be forced, though.
Tests needed some refactoring to account for the various permutations.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Fixes #126
|
| |
|
|
| |
Add cross references and some formatting fixes.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Also bring the ``classImplements`` lines closer to the interface
declaration. This helped me be sure that nothing was missed and that
all the repetitions of the names matched.
|
| |
|
| |
* Fixes #12 - registering instance methods as listeners doesn’t allow to easily unregister them as the registry tries to find the handler with 'is' but it should use '==' to allow the python BoundMethod wrapper (which is a new instance every time instance.$methodname is accessed).
|
| |
|
| |
Thank you for follows. I misread it for carriage return.
|
| |
|
|
|
|
| |
call PyObject_GC_UnTrack() in tp_dealloc()
see the following sites for details:
* https://bugs.python.org/issue31095
* https://github.com/python/cpython/pull/2974
|
| | |
|
| |\
| |
| | |
Enable combined coverage reports under tox and branch coverage
|
| | |
| |
| |
| | |
callers already do this guard; be more explicit about ClassType in test_odd_declarations
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Fixes #91
Remove many (or most) now-redundant 'pragma: no cover'.
A few minor test changes to get full branch coverage.
|
| |/
|
|
| |
Fixes #93
|
| |
|
|
|
|
|
|
|
|
| |
This is an alternative to #86 and was suggested by @mgedmin in #85.
There are tests to be sure this works for subclasses like Pyramid's
Registry that extend dict too.
This doesn't change the pickle format, we were storing the output of
object.__reduce__ previously.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Get as close to 100% coverage as possible.
Without conflicting with #86.
This is almost entirely trivial changes:
- Make dummy methods that should never be called either raise
NotImplementedError or call self.fail() in tests.
- Standardize the no-coverage pragma
- Add a few pragmas where coverage varies across
versions/implementations, mostly for the sake of tox (travis should
hit them all).
* Convert tox to run the coverage command, like travis. A follow up should have it produce coverage for all python versions/implementations.
Fixes #87
* Adjust coverage config for py2 only tests; fix typo; finish replacing self with cls
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Test sanity cleanups
Partially addresses #87
- Remove manual lists of tests in favor of loadTestsFromName. This
mostly gets all test runners running the same number of tests.
- Remove `additional_tests`, which was just duplicating the discovered
tests. No modern test runner seems to need it.
- Change the two compatibility skip decorators to actually use
unitetest skips, which helps with the reporting.
* Per @tseaver, drop most test_suite functions.
* Port remaining doctest to unittest.
* Make the odd tests work on all supported python versions
|
| | |
|
| |
|
|
|
| |
simplification, avoids spurious test failures when checking for
leaks in tests with persistent registries.
|