Skip to content

Commit

Permalink
Merge pull request #67 from zopefoundation/issue66
Browse files Browse the repository at this point in the history
Reach 100% coverage.
  • Loading branch information
jamadden committed Oct 11, 2018
2 parents 0567379 + a04ef4b commit 0d29b05
Show file tree
Hide file tree
Showing 15 changed files with 163 additions and 254 deletions.
4 changes: 3 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ source = transaction

[report]
exclude_lines =
# pragma: no cover
pragma: no cover
raise AssertionError
raise NotImplementedError
class I[A-Z]\w+\((Interface|I[A-Z].*)\):
show_missing = true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ coverage.xml
*.egg-info
.installed.cfg
dist/
htmlcov/
64 changes: 35 additions & 29 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
Changes
=======
=========
Changes
=========

2.2.2 (unreleased)
------------------
2.3.0 (unreleased)
==================

- Add support for Python 3.7.

- Reach 100% test coverage.

- Fix ``transaction.manager.run`` formatting transaction notes when
given a mix of byte and text strings, such as can happen in Python 2
with ``unicode_literals``.

2.2.1 (2018-03-27)
------------------
==================

- Make documentation index more user friendly; move old docs to developer
section.
Expand All @@ -18,7 +24,7 @@ Changes


2.2.0 (2018-02-27)
------------------
==================

- Add support for Python 3.6.

Expand All @@ -36,14 +42,14 @@ Changes


2.1.2 (2017-03-11)
------------------
==================

- To avoid leaking memory, don't include unexpected value in warnings
about non-text transaction meta data.


2.1.1 (2017-03-11)
------------------
==================

- For backward compatibility, relax the requirements that transaction
meta data (user or description) be text:
Expand All @@ -56,7 +62,7 @@ Changes


2.1.0 (2017-02-08)
------------------
==================

Added a transaction-manager explicit mode. Explicit mode makes some
kinds of application bugs easier to detect and potentially allows data
Expand All @@ -65,7 +71,7 @@ managers to manage resources more efficiently.
(This addresses https://github.com/zopefoundation/transaction/issues/35.)

2.0.3 (2016-11-17)
------------------
==================

- The user and description fields must now be set with text (unicode)
data. Previously, if bytes were provided, they'd be decoded as
Expand All @@ -76,13 +82,13 @@ managers to manage resources more efficiently.
renamed to ``extension``.

2.0.2 (2016-11-13)
------------------
==================

- Fixed: Some legacy applications expect the transaction _extension
attribute to be mutable and it wasn't.

2.0.1 (2016-11-11)
------------------
==================

- The transaction ``user`` and ``description`` attributes are now
defined to be text (unicode) as opposed to Python the ``str`` type.
Expand All @@ -105,7 +111,7 @@ possible that these changes will be breaking, so we're also increasing
the major version number.

1.7.0 (2016-11-08)
------------------
==================

- Added a transaction-manager ``run`` method for running a function as a
transaction, retrying as necessary on transient errors.
Expand All @@ -117,14 +123,14 @@ the major version number.
implemented) and removing 'self' from two methods.

1.6.1 (2016-06-10)
------------------
==================

- Fixed: Synchonizers that registered with transaction managers when
transactions were in progress didn't have their newTransaction
methods called to let them know of the in-progress transactions.

1.6.0 (2016-05-21)
------------------
==================

- New transaction API for storing data on behalf of objects, such as
data managers.
Expand All @@ -133,7 +139,7 @@ the major version number.
committed or aborted.

1.5.0 (2016-05-05)
------------------
==================

- Drop support for Python 2.6 and 3.2.

Expand All @@ -143,7 +149,7 @@ the major version number.
client tests.

1.4.4 (2015-05-19)
------------------
==================

- Use the standard ``valuerefs()`` method rather than relying on
implementation details of ``WeakValueDictionary`` in ``WeakSet``.
Expand All @@ -153,17 +159,17 @@ the major version number.
- Require 100% branch coverage (in addition to 100% statement coverage).

1.4.3 (2014-03-20)
------------------
==================

- Add support for Python 3.4.

1.4.2 (skipped)
---------------
===============

- Released in error as 1.4.3.

1.4.1 (2013-02-20)
------------------
==================

- Document that values returned by ``sortKey`` must be strings, in order
to guarantee total ordering.
Expand All @@ -172,12 +178,12 @@ the major version number.
in transaction.weakset on Python 3.

1.4.0 (2013-01-03)
------------------
==================

- Updated Trove classifiers.

1.4.0b1 (2012-12-18)
--------------------
====================

- Converted existing doctests into Sphinx documentation (snippets are
exercised via 'tox').
Expand All @@ -202,7 +208,7 @@ the major version number.
would be swallowed inappropriately.

1.3.0 (2012-05-16)
------------------
==================

- Added Sphinx API docuementation.

Expand All @@ -228,7 +234,7 @@ the major version number.
exception to be raised).

1.2.0 (2011-12-05)
------------------
==================

New Features:

Expand All @@ -238,7 +244,7 @@ New Features:
"transaction" under these Python versions).

1.1.1 (2010-09-16)
------------------
==================

Bug Fixes:

Expand All @@ -250,7 +256,7 @@ Bug Fixes:
and add test.

1.1.0 (1010-05-12)
------------------
==================

New Features:

Expand Down Expand Up @@ -287,23 +293,23 @@ Bugs fixed:
https://bugs.launchpad.net/zodb/+bug/239086

1.0.1 (2010-05-07)
------------------
==================

- LP #142464: remove double newline between log entries: it makes doing
smarter formatting harder.

- Updated tests to remove use of deprecated ``zope.testing.doctest``.

1.0.0 (2009-07-24)
------------------
==================

- Fix test that incorrectly relied on the order of a list that was generated
from a dict.

- Remove crufty DEPENDENCIES.cfg left over from zpkg.

1.0a1 (2007-12-18)
------------------
==================

= Initial release, branched from ZODB trunk on 2007-11-08 (aka
"3.9.0dev").
Expand Down
10 changes: 4 additions & 6 deletions docs/hooks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Now register the hook with a transaction.
.. doctest::

>>> from transaction import begin
>>> from transaction._compat import func_name
>>> import transaction
>>> t = begin()
>>> t.addBeforeCommitHook(hook, '1')
Expand All @@ -43,7 +42,7 @@ We can see that the hook is indeed registered.

.. doctest::

>>> [(func_name(hook), args, kws)
>>> [(hook.__name__, args, kws)
... for hook, args, kws in t.getBeforeCommitHooks()]
[('hook', ('1',), {})]

Expand Down Expand Up @@ -141,7 +140,7 @@ They are returned in the same order by getBeforeCommitHooks.

.. doctest::

>>> [(func_name(hook), args, kws) #doctest: +NORMALIZE_WHITESPACE
>>> [(hook.__name__, args, kws) #doctest: +NORMALIZE_WHITESPACE
... for hook, args, kws in t.getBeforeCommitHooks()]
[('hook', ('4',), {'kw1': '4.1'}),
('hook', ('5',), {'kw2': '5.2'})]
Expand Down Expand Up @@ -201,7 +200,6 @@ Now register the hook with a transaction.
.. doctest::

>>> from transaction import begin
>>> from transaction._compat import func_name
>>> t = begin()
>>> t.addAfterCommitHook(hook, '1')

Expand All @@ -210,7 +208,7 @@ We can see that the hook is indeed registered.
.. doctest::


>>> [(func_name(hook), args, kws)
>>> [(hook.__name__, args, kws)
... for hook, args, kws in t.getAfterCommitHooks()]
[('hook', ('1',), {})]

Expand Down Expand Up @@ -307,7 +305,7 @@ They are returned in the same order by getAfterCommitHooks.

.. doctest::

>>> [(func_name(hook), args, kws) #doctest: +NORMALIZE_WHITESPACE
>>> [(hook.__name__, args, kws) #doctest: +NORMALIZE_WHITESPACE
... for hook, args, kws in t.getAfterCommitHooks()]
[('hook', ('4',), {'kw1': '4.1'}),
('hook', ('5',), {'kw2': '5.2'})]
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ basepython =
commands =
coverage run -m zope.testrunner --test-path=.
coverage run -a -m sphinx.cmd.build -b doctest -d docs/_build/doctrees docs docs/_build/doctest
coverage report --fail-under=97
coverage report --fail-under=100
deps =
{[testenv]deps}
coverage
Expand Down
Loading

0 comments on commit 0d29b05

Please sign in to comment.