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
nexedi
ZODB
Commits
63dcee8d
Commit
63dcee8d
authored
Apr 12, 2022
by
Dieter Maurer
Committed by
GitHub
Apr 12, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #360 from zopefoundation/blob_tests
make blob test `commit_from_wrong_partition` more robust
parents
1226c9d3
69d3828c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
0 deletions
+11
-0
src/ZODB/FileStorage/iterator.test
src/ZODB/FileStorage/iterator.test
+3
-0
src/ZODB/FileStorage/tests.py
src/ZODB/FileStorage/tests.py
+3
-0
src/ZODB/tests/loggingsupport.py
src/ZODB/tests/loggingsupport.py
+4
-0
src/ZODB/tests/testblob.py
src/ZODB/tests/testblob.py
+1
-0
No files found.
src/ZODB/FileStorage/iterator.test
View file @
63dcee8d
...
...
@@ -49,7 +49,9 @@ logging:
>>> import logging, sys
>>> old_log_level = logging.getLogger().getEffectiveLevel()
>>> old_log_disabled = logging.getLogger().disabled
>>> logging.getLogger().setLevel(logging.DEBUG)
>>> logging.getLogger().disabled = False
>>> handler = logging.StreamHandler(sys.stdout)
>>> logging.getLogger().addHandler(handler)
...
...
@@ -144,6 +146,7 @@ starting point, or just pick up where another iterator left off:
>>>
it
.
close
()
>>>
logging
.
getLogger
()
.
setLevel
(
old_log_level
)
>>>
logging
.
getLogger
()
.
disabled
=
old_log_disabled
>>>
logging
.
getLogger
()
.
removeHandler
(
handler
)
...
...
src/ZODB/FileStorage/tests.py
View file @
63dcee8d
...
...
@@ -176,6 +176,8 @@ Make sure we can restore:
>>> logger = logging.getLogger('ZODB.FileStorage')
>>> logger.setLevel(logging.DEBUG)
>>> logger.addHandler(handler)
>>> log_disabled = logger.disabled
>>> logger.disabled = False
>>> index, pos, tid = fs._restore_index()
>>> index.items() == fs._index.items()
True
...
...
@@ -186,6 +188,7 @@ cleanup
>>> fs.close()
>>> logger.setLevel(logging.NOTSET)
>>> logger.removeHandler(handler)
>>> logger.disabled = log_disabled
>>> sys.setrecursionlimit(old_limit)
"""
...
...
src/ZODB/tests/loggingsupport.py
View file @
63dcee8d
...
...
@@ -83,6 +83,7 @@ class Handler(logging.Handler):
def
setLoggerLevel
(
self
,
level
=
1
):
self
.
level
=
level
self
.
oldlevels
=
{}
self
.
olddisabled
=
{}
def
emit
(
self
,
record
):
self
.
records
.
append
(
record
)
...
...
@@ -94,13 +95,16 @@ class Handler(logging.Handler):
for
name
in
self
.
names
:
logger
=
logging
.
getLogger
(
name
)
self
.
oldlevels
[
name
]
=
logger
.
level
self
.
olddisabled
[
name
]
=
logger
.
disabled
logger
.
setLevel
(
self
.
level
)
logger
.
disabled
=
False
logger
.
addHandler
(
self
)
def
uninstall
(
self
):
for
name
in
self
.
names
:
logger
=
logging
.
getLogger
(
name
)
logger
.
setLevel
(
self
.
oldlevels
[
name
])
logger
.
disabled
=
self
.
olddisabled
[
name
]
logger
.
removeHandler
(
self
)
def
__str__
(
self
):
...
...
src/ZODB/tests/testblob.py
View file @
63dcee8d
...
...
@@ -379,6 +379,7 @@ def commit_from_wrong_partition():
>>> logger.propagate = False
>>> logger.setLevel(logging.DEBUG)
>>> logger.addHandler(handler)
>>> logger.disabled = False
>>> blob_storage = create_storage() # noqa: F821 undefined name
>>> database = DB(blob_storage)
...
...
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