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
7125c3a1
Commit
7125c3a1
authored
Jul 10, 2010
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed spurious failure under Python 2.7
parent
56c5342f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
47 deletions
+10
-47
src/ZEO/tests/testZEO.py
src/ZEO/tests/testZEO.py
+1
-1
src/ZODB/tests/testDB.py
src/ZODB/tests/testDB.py
+9
-46
No files found.
src/ZEO/tests/testZEO.py
View file @
7125c3a1
...
...
@@ -1294,7 +1294,7 @@ Invalidations could cause errors when closing client storages,
>>> thread = threading.Thread(target=mad_write_thread)
>>> thread.setDaemon(True)
>>> thread.start()
>>> writing.wait()
>>>
_ =
writing.wait()
>>> time.sleep(.01)
>>> for i in range(10):
... conn = ZEO.connection(addr)
...
...
src/ZODB/tests/testDB.py
View file @
7125c3a1
...
...
@@ -269,16 +269,10 @@ if sys.version_info >= (2, 6):
def
connection_allows_empty_version_for_idiots
():
r"""
>>> import sys, StringIO
>>> stderr = sys.stderr
>>> sys.stderr = StringIO.StringIO()
>>> db = ZODB.DB('t.fs')
>>> c = db.open('')
>>> sys.stderr.getvalue() # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
'...: DeprecationWarning: A version string was passed to
open.\nThe first argument is a transaction manager...
>>> sys.stderr = stderr
>>> c = ZODB.tests.util.assert_deprecated(
... (lambda : db.open('')),
... 'A version string was passed to open')
>>> c.root()
{}
>>> db.close()
...
...
@@ -289,36 +283,11 @@ def warn_when_data_records_are_big():
When data records are large, a warning is issued to try to prevent new
users from shooting themselves in the foot.
>>> import warnings
>>> old_warn = warnings.warn
>>> def faux_warn(message, *args):
... print message,
... if args: print args
>>> warnings.warn = faux_warn
>>> db = ZODB.DB('t.fs', create=True)
>>> conn = db.open()
>>> conn.root.x = 'x'*(1<<24)
>>> transaction.commit()
The <class 'persistent.mapping.PersistentMapping'>
object you're saving is large. (16777284 bytes.)
<BLANKLINE>
Perhaps you're storing media which should be stored in blobs.
<BLANKLINE>
Perhaps you're using a non-scalable data structure, such as a
PersistentMapping or PersistentList.
<BLANKLINE>
Perhaps you're storing data in objects that aren't persistent at
all. In cases like that, the data is stored in the record of the
containing persistent object.
<BLANKLINE>
In any case, storing records this big is probably a bad idea.
<BLANKLINE>
If you insist and want to get rid of this warning, use the
large_record_size option of the ZODB.DB constructor (or the
large-record-size option in a configuration file) to specify a larger
size.
>>> ZODB.tests.util.assert_warning(UserWarning, transaction.commit,
... "object you're saving is large.")
>>> db.close()
The large_record_size option can be used to control the record size:
...
...
@@ -329,10 +298,8 @@ The large_record_size option can be used to control the record size:
>>> transaction.commit()
>>> conn.root.x = 'x'*999
>>> transaction.commit() # doctest: +ELLIPSIS
The <class 'persistent.mapping.PersistentMapping'>
object you're saving is large. (1067 bytes.)
...
>>> ZODB.tests.util.assert_warning(UserWarning, transaction.commit,
... "object you're saving is large.")
>>> db.close()
...
...
@@ -353,14 +320,10 @@ We can also specify it using a configuration option:
>>> transaction.commit()
>>> conn.root.x = 'x'*(1<<20)
>>> transaction.commit() # doctest: +ELLIPSIS
The <class 'persistent.mapping.PersistentMapping'>
object you're saving is large. (1048644 bytes.)
...
>>> ZODB.tests.util.assert_warning(UserWarning, transaction.commit,
... "object you're saving is large.")
>>> db.close()
>>> warnings.warn = old_warn
"""
def
test_suite
():
...
...
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