Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZEO
Commits
16072ab8
Commit
16072ab8
authored
Apr 14, 2004
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Install a WarningsHook for checkLocalTransactions.
parent
29fd0f2d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
src/ZODB/tests/testZODB.py
src/ZODB/tests/testZODB.py
+6
-0
No files found.
src/ZODB/tests/testZODB.py
View file @
16072ab8
...
@@ -16,6 +16,7 @@ import unittest
...
@@ -16,6 +16,7 @@ import unittest
import
ZODB
import
ZODB
import
ZODB.FileStorage
import
ZODB.FileStorage
from
ZODB.POSException
import
ReadConflictError
,
ConflictError
from
ZODB.POSException
import
ReadConflictError
,
ConflictError
from
ZODB.tests.warnhook
import
WarningsHook
from
persistent
import
Persistent
from
persistent
import
Persistent
from
persistent.mapping
import
PersistentMapping
from
persistent.mapping
import
PersistentMapping
...
@@ -209,6 +210,8 @@ class ZODBTests(unittest.TestCase):
...
@@ -209,6 +210,8 @@ class ZODBTests(unittest.TestCase):
# not the thread.
# not the thread.
conn1
=
self
.
_db
.
open
()
conn1
=
self
.
_db
.
open
()
conn2
=
self
.
_db
.
open
()
conn2
=
self
.
_db
.
open
()
hook
=
WarningsHook
()
hook
.
install
()
try
:
try
:
conn1
.
setLocalTransaction
()
conn1
.
setLocalTransaction
()
conn2
.
setLocalTransaction
()
conn2
.
setLocalTransaction
()
...
@@ -238,9 +241,12 @@ class ZODBTests(unittest.TestCase):
...
@@ -238,9 +241,12 @@ class ZODBTests(unittest.TestCase):
conn2
.
sync
()
conn2
.
sync
()
self
.
assertEqual
(
r1
[
'item'
],
2
)
self
.
assertEqual
(
r1
[
'item'
],
2
)
self
.
assertEqual
(
r2
[
'item'
],
2
)
self
.
assertEqual
(
r2
[
'item'
],
2
)
for
msg
,
obj
,
filename
,
lineno
in
hook
.
warnings
:
self
.
assert_
(
msg
.
startswith
(
"getTransaction() is deprecated."
))
finally
:
finally
:
conn1
.
close
()
conn1
.
close
()
conn2
.
close
()
conn2
.
close
()
hook
.
uninstall
()
def
checkReadConflict
(
self
):
def
checkReadConflict
(
self
):
self
.
obj
=
P
()
self
.
obj
=
P
()
...
...
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