Skip to content

Commit

Permalink
Work around ZODB registering level names backwards.
Browse files Browse the repository at this point in the history
Before Python 3.4, the logging module registered them in both
directions, but quit doing so in 3.4, breaking doctests which expected
to display custom level name ("BLATHER").
  • Loading branch information
tseaver committed Dec 27, 2014
1 parent 18e7f0c commit 428643f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/ZEO/tests/testZEO2.py
Expand Up @@ -224,6 +224,13 @@ def some_basic_locking_tests():
>>> logging.getLogger('ZEO').addHandler(handler)
>>> logging.getLogger('ZEO').setLevel(logging.DEBUG)
Work around the fact that ZODB registers level names backwards, which
quit working in Python 3.4:
>>> import logging
>>> from ZODB.loglevels import BLATHER
>>> logging.addLevelName(BLATHER, "BLATHER")
We start a transaction and vote, this leads to getting the lock.
>>> zs1 = ZEO.tests.servertesting.client(server, '1')
Expand Down Expand Up @@ -435,6 +442,13 @@ def lock_sanity_check():
>>> logging.getLogger('ZEO').addHandler(handler)
>>> logging.getLogger('ZEO').setLevel(logging.DEBUG)
Work around the fact that ZODB registers level names backwards, which
quit working in Python 3.4:
>>> import logging
>>> from ZODB.loglevels import BLATHER
>>> logging.addLevelName(BLATHER, "BLATHER")
Now, we'll start a transaction, get the lock and then mark the
ZEOStorage as closed and see if trying to get a lock cleans it up:
Expand Down

0 comments on commit 428643f

Please sign in to comment.