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
Joshua
zodb
Commits
5ec19b76
Commit
5ec19b76
authored
Mar 12, 2004
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add another init() method so cache tests can be run in a loop.
parent
723de304
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
src/ZODB/tests/test_cache.py
src/ZODB/tests/test_cache.py
+7
-1
No files found.
src/ZODB/tests/test_cache.py
View file @
5ec19b76
...
...
@@ -26,6 +26,11 @@ class RecalcitrantObject(Persistent):
def
_p_deactivate
(
self
):
self
.
__class__
.
deactivations
+=
1
def
init
(
cls
):
cls
.
deactivations
=
0
init
=
classmethod
(
init
)
class
RegularObject
(
Persistent
):
deactivations
=
0
...
...
@@ -120,6 +125,7 @@ class CacheTests:
also return when it's looked at each item, regardless of whether
it became a ghost.
>>> RecalcitrantObject.init()
>>> db = databaseFromString("<zodb>\n"
... "cache-size 4\n"
... "<mappingstorage/>\n"
...
...
@@ -138,7 +144,7 @@ class CacheTests:
The Connection calls cacheGC() after it commits a transaction.
Since the cache will now have more objects that it's target size,
it will call _p_deactivate() on each RecalcitrantObject.
>>> RecalcitrantObject.deactivations
5
>>> [o._p_state for o in L]
...
...
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