<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/zope-interface.git/src/zope/interface/tests, branch issue93</title>
<subtitle>github.com: zopefoundation/zope.interface.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/zope-interface.git/'/>
<entry>
<title>Fix the cache getting out of sync with _utility_registrations.</title>
<updated>2017-06-14T13:51:43+00:00</updated>
<author>
<name>Jason Madden</name>
<email>jamadden@gmail.com</email>
</author>
<published>2017-06-14T13:51:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/zope-interface.git/commit/?id=751a95088567e4d219ecac6f2145f26b5753e424'/>
<id>751a95088567e4d219ecac6f2145f26b5753e424</id>
<content type='text'>
Fixes #93
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #93
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix #85 by implementing __reduce__ to omit _v_ attributes.</title>
<updated>2017-06-14T11:51:22+00:00</updated>
<author>
<name>Jason Madden</name>
<email>jamadden@gmail.com</email>
</author>
<published>2017-06-14T11:51:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/zope-interface.git/commit/?id=9de7239b28a9817ad43c04e438743a22d964545e'/>
<id>9de7239b28a9817ad43c04e438743a22d964545e</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>100% coverage (#90)</title>
<updated>2017-06-12T14:05:13+00:00</updated>
<author>
<name>Jason Madden</name>
<email>jason+github@nextthought.com</email>
</author>
<published>2017-06-12T14:05:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/zope-interface.git/commit/?id=1f00dcfa8e7f4cc2e5706c9af44f1cab20b22d88'/>
<id>1f00dcfa8e7f4cc2e5706c9af44f1cab20b22d88</id>
<content type='text'>
* 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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 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
</pre>
</div>
</content>
</entry>
<entry>
<title>Test sanity cleanups (#88)</title>
<updated>2017-06-09T02:19:13+00:00</updated>
<author>
<name>Jason Madden</name>
<email>jason+github@nextthought.com</email>
</author>
<published>2017-06-09T02:19:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/zope-interface.git/commit/?id=8bcfddcfbe8a597c7af0de191d51569fa1b1f603'/>
<id>8bcfddcfbe8a597c7af0de191d51569fa1b1f603</id>
<content type='text'>
* 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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 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
</pre>
</div>
</content>
</entry>
<entry>
<title>Simply the caching of utility-registration data. In addition to</title>
<updated>2017-05-12T21:20:59+00:00</updated>
<author>
<name>Jim Fulton</name>
<email>jim@jimfulton.info</email>
</author>
<published>2017-05-12T21:20:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/zope-interface.git/commit/?id=38d1c82de85cad2f7697d40212153258248999c3'/>
<id>38d1c82de85cad2f7697d40212153258248999c3</id>
<content type='text'>
simplification, avoids spurious test failures when checking for
leaks in tests with persistent registries.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
simplification, avoids spurious test failures when checking for
leaks in tests with persistent registries.
</pre>
</div>
</content>
</entry>
<entry>
<title>Raise ValueError if non-text name passed to adapter registry methods.</title>
<updated>2017-05-04T09:50:35+00:00</updated>
<author>
<name>Tres Seaver</name>
<email>tseaver@palladion.com</email>
</author>
<published>2017-05-04T09:47:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/zope-interface.git/commit/?id=81f50ca16007d0eb6beb7a51b5bf32b6f1cb410a'/>
<id>81f50ca16007d0eb6beb7a51b5bf32b6f1cb410a</id>
<content type='text'>
Prevents corruption of lookup cache.

Alternative to fix proposed in #75.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Prevents corruption of lookup cache.

Alternative to fix proposed in #75.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add tests asserting that optimzations are / are not present as expected.</title>
<updated>2016-11-15T22:54:25+00:00</updated>
<author>
<name>Tres Seaver</name>
<email>tseaver@palladion.com</email>
</author>
<published>2016-11-15T22:54:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/zope-interface.git/commit/?id=b27a50f4131ccf10732d7ebd20b3f8fa8afd397c'/>
<id>b27a50f4131ccf10732d7ebd20b3f8fa8afd397c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix equality testing of implementedBy objects that have been proxied. Fixes #55.</title>
<updated>2016-09-02T23:20:25+00:00</updated>
<author>
<name>Jason Madden</name>
<email>jamadden@gmail.com</email>
</author>
<published>2016-09-02T23:20:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/zope-interface.git/commit/?id=c0e980b4b986a95a7699d0f417d6f8ff185f48d7'/>
<id>c0e980b4b986a95a7699d0f417d6f8ff185f48d7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Support Components subclasses that are not hashable. (#54)</title>
<updated>2016-08-31T12:41:51+00:00</updated>
<author>
<name>Jason Madden</name>
<email>jason+github@nextthought.com</email>
</author>
<published>2016-08-31T12:41:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/zope-interface.git/commit/?id=14c8b2966011bc0dcab7e908cd80cb61dfd413cb'/>
<id>14c8b2966011bc0dcab7e908cd80cb61dfd413cb</id>
<content type='text'>
* Support Components subclasses that are not hashable.

Fixes #53.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Support Components subclasses that are not hashable.

Fixes #53.</pre>
</div>
</content>
</entry>
<entry>
<title>Use dictionary lookups for testing subscribed status.</title>
<updated>2016-08-19T13:18:39+00:00</updated>
<author>
<name>Jason Madden</name>
<email>jamadden@gmail.com</email>
</author>
<published>2016-08-19T13:18:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/zope-interface.git/commit/?id=58ef4872922803fac3429d88fb3c58ae509b17c5'/>
<id>58ef4872922803fac3429d88fb3c58ae509b17c5</id>
<content type='text'>
Fixes #46.

Benchmarks show a dramatic improvement; not quite as good as the
demonstration in #46 because the implementation had to be a bit more
complex to properly handle unregistration, but still very good. Here it
is with 20,000 items already registered:
```
   %time add_to_reg(reg, 1000)
   CPU times: user 190 ms, sys: 19.3 ms, total: 209 ms
   Wall time: 203 ms
```

Here's a profile with about 100,000 utilities registered:
```
 %prun add_to_reg(reg, 1000)
         80005 function calls (79005 primitive calls) in 0.713 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
     1000    0.596    0.001    0.621    0.001 adapter.py:202(subscribe)
    12000    0.016    0.000    0.019    0.000 interface.py:518(__hash__)
     1000    0.010    0.000    0.709    0.001 registry.py:206(registerUtility)
3000/2000    0.009    0.000    0.014    0.000 interface.py:255(interfaces)
     2000    0.008    0.000    0.022    0.000 adapter.py:637(changed)
     1000    0.008    0.000    0.025    0.000 registry.py:498(_getUtilityProvided)
     9000    0.008    0.000    0.017    0.000 {method 'get' of 'dict' objects}
     1000    0.008    0.000    0.027    0.000 adapter.py:102(register)
     2000    0.006    0.000    0.008    0.000 adapter.py:450(changed)
     1000    0.005    0.000    0.663    0.001 registry.py:145(registerUtility)
```

I was very careful not to change the pickle at all.

zope.interface and zope.component tests have been run and both pass. (It
was necessary to account for the underlying objects changing because of
the way zope.component cleans up after tests.)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #46.

Benchmarks show a dramatic improvement; not quite as good as the
demonstration in #46 because the implementation had to be a bit more
complex to properly handle unregistration, but still very good. Here it
is with 20,000 items already registered:
```
   %time add_to_reg(reg, 1000)
   CPU times: user 190 ms, sys: 19.3 ms, total: 209 ms
   Wall time: 203 ms
```

Here's a profile with about 100,000 utilities registered:
```
 %prun add_to_reg(reg, 1000)
         80005 function calls (79005 primitive calls) in 0.713 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
     1000    0.596    0.001    0.621    0.001 adapter.py:202(subscribe)
    12000    0.016    0.000    0.019    0.000 interface.py:518(__hash__)
     1000    0.010    0.000    0.709    0.001 registry.py:206(registerUtility)
3000/2000    0.009    0.000    0.014    0.000 interface.py:255(interfaces)
     2000    0.008    0.000    0.022    0.000 adapter.py:637(changed)
     1000    0.008    0.000    0.025    0.000 registry.py:498(_getUtilityProvided)
     9000    0.008    0.000    0.017    0.000 {method 'get' of 'dict' objects}
     1000    0.008    0.000    0.027    0.000 adapter.py:102(register)
     2000    0.006    0.000    0.008    0.000 adapter.py:450(changed)
     1000    0.005    0.000    0.663    0.001 registry.py:145(registerUtility)
```

I was very careful not to change the pickle at all.

zope.interface and zope.component tests have been run and both pass. (It
was necessary to account for the underlying objects changing because of
the way zope.component cleans up after tests.)
</pre>
</div>
</content>
</entry>
</feed>
