Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
a529fd84
Commit
a529fd84
authored
Dec 01, 2012
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed: An elaborate test for trvial logic corrupted module state in a
way that made other tests fail spuriously.
parent
b300f227
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
49 deletions
+7
-49
CHANGES.txt
CHANGES.txt
+6
-0
src/ZODB/event.py
src/ZODB/event.py
+1
-48
src/ZODB/tests/testZODB.py
src/ZODB/tests/testZODB.py
+0
-1
No files found.
CHANGES.txt
View file @
a529fd84
...
...
@@ -2,6 +2,12 @@
Change History
================
4.0.0a3 (2012-12-01)
=====================
Fixed: An elaborate test for trvial logic corrupted module state in a
way that made other tests fail spuriously.
4.0.0a2 (2012-11-13)
=====================
...
...
src/ZODB/event.py
View file @
a529fd84
...
...
@@ -11,55 +11,8 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
def
_noop
(
event
):
"""
Tests:
>>> import sys, ZODB.event
>>> notify = ZODB.event
>>> zopemod = sys.modules.get('zope', False)
>>> event = sys.modules.get('zope.event', False)
>>> if event:
... del zopemod.event
... sys.modules['zope.event'] = None
... _ = reload(ZODB.event)
If zope.event isn't installed, then notify is _noop
>>> ZODB.event.notify is ZODB.event._noop
True
If zope.event is installed, then notify is zope.event.notify:
>>> zope = sys.modules['zope'] = type(sys)('zope')
>>> zope.event = sys.modules['zope.event'] = type(sys)('zope.event')
>>> zope.event.notify = lambda e: None
>>> _ = reload(ZODB.event)
>>> ZODB.event.notify is zope.event.notify
True
Cleanup:
>>> if event is False:
... del sys.modules['zope.event']
... else:
... if event:
... zopemod.event = event
... sys.modules['zope.event'] = event
>>> if zopemod is False:
... del sys.modules['zope']
... else:
... sys.modules['zope'] = zopemod
>>> ZODB.event.notify = notify
"""
pass
try
:
from
zope.event
import
notify
except
ImportError
:
notify
=
_noop
notify
=
lambda
event
:
None
src/ZODB/tests/testZODB.py
View file @
a529fd84
...
...
@@ -614,7 +614,6 @@ class PoisonedObject:
def
test_suite
():
return
unittest
.
TestSuite
((
unittest
.
makeSuite
(
ZODBTests
,
'check'
),
doctest
.
DocTestSuite
(
'ZODB.event'
),
))
if
__name__
==
"__main__"
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment