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
2d59dd41
Commit
2d59dd41
authored
Mar 26, 2007
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added doctest setup helper functions.
parent
25dec89b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
src/ZODB/tests/util.py
src/ZODB/tests/util.py
+19
-0
No files found.
src/ZODB/tests/util.py
View file @
2d59dd41
...
...
@@ -16,7 +16,11 @@
$Id$
"""
import
os
import
shutil
import
tempfile
import
time
import
persistent
import
transaction
from
ZODB.MappingStorage
import
MappingStorage
...
...
@@ -38,3 +42,18 @@ class P(persistent.Persistent):
def
__repr__
(
self
):
return
'P(%s)'
%
self
.
name
def
setUp
(
test
):
test
.
globs
[
'__teardown_stack__'
]
=
[]
tmp
=
tempfile
.
mkdtemp
(
'test'
)
registerTearDown
(
test
,
lambda
:
shutil
.
rmtree
(
tmp
))
here
=
os
.
getcwd
()
registerTearDown
(
test
,
lambda
:
os
.
chdir
(
here
))
os
.
chdir
(
tmp
)
def
registerTearDown
(
test
,
func
):
test
.
globs
[
'__teardown_stack__'
].
append
(
func
)
def
tearDown
(
test
):
for
f
in
test
.
globs
[
'__teardown_stack__'
]:
f
()
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