Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
transaction
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
transaction
Commits
80c33531
Commit
80c33531
authored
May 16, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add explicit support for PyPy.
parent
d56d17df
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
6 deletions
+14
-6
CHANGES.txt
CHANGES.txt
+2
-0
setup.py
setup.py
+1
-0
transaction/tests/convenience.txt
transaction/tests/convenience.txt
+2
-2
transaction/tests/savepoint.txt
transaction/tests/savepoint.txt
+2
-2
transaction/tests/test_transaction.py
transaction/tests/test_transaction.py
+3
-2
transaction/tests/test_weakset.py
transaction/tests/test_weakset.py
+4
-0
No files found.
CHANGES.txt
View file @
80c33531
...
...
@@ -4,6 +4,8 @@ Changes
1.2.1 (unreleased)
------------------
- Added explicit support for PyPy.
- Dropped use of Python3-impatible ``zope.interface.implements`` class
advisor in favor of ``zope.interface.implementer`` class decorator.
...
...
setup.py
View file @
80c33531
...
...
@@ -41,6 +41,7 @@ setup(name='transaction',
"Programming Language :: Python :: 3"
,
"Programming Language :: Python :: 3.2"
,
"Programming Language :: Python :: Implementation :: CPython"
,
"Programming Language :: Python :: Implementation :: PyPy"
,
],
author
=
"Zope Corporation"
,
author_email
=
"zodb-dev@zope.org"
,
...
...
transaction/tests/convenience.txt
View file @
80c33531
...
...
@@ -27,12 +27,12 @@ We can use it with a manager:
>>> dm.last_note
'test 3'
>>> with transaction.manager:
>>> with transaction.manager:
#doctest ELLIPSIS
... dm['z'] = 4
... xxx
Traceback (most recent call last):
...
NameError: name 'xxx' is not defined
NameError:
...
name 'xxx' is not defined
>>> dm['z']
3
...
...
transaction/tests/savepoint.txt
View file @
80c33531
...
...
@@ -82,7 +82,7 @@ way, it rolls back all of its changes and prints the error:
... print("%s %s" % ('Updated', name))
... except Exception as error:
... savepoint.rollback()
... print("%s
%s" % ('Unexpected exception', error
))
... print("%s
" % ('Unexpected exception'
))
Now let's try applying some entries:
...
...
@@ -117,7 +117,7 @@ If we provide entries that cause an unexpected error:
... ])
Updated bob
Updated sally
Unexpected exception
unsupported operand type(s) for +=: 'float' and 'str'
Unexpected exception
Because the apply_entries used a savepoint for the entire function, it was
able to rollback the partial changes without rolling back changes made in the
...
...
transaction/tests/test_transaction.py
View file @
80c33531
...
...
@@ -36,7 +36,7 @@ TODO
add in tests for objects which are modified multiple times,
for example an object that gets modified in multiple sub txns.
"""
from
doctest
import
DocTestSuite
,
DocFileSuite
from
doctest
import
DocTestSuite
,
DocFileSuite
,
IGNORE_EXCEPTION_DETAIL
import
struct
import
sys
...
...
@@ -769,7 +769,8 @@ def test_suite():
unittest
.
makeSuite
(
Test_oid_repr
),
))
if
sys
.
version_info
>=
(
2
,
6
):
suite
.
addTest
(
DocFileSuite
(
'convenience.txt'
))
suite
.
addTest
(
DocFileSuite
(
'convenience.txt'
,
optionflags
=
IGNORE_EXCEPTION_DETAIL
))
return
suite
...
...
transaction/tests/test_weakset.py
View file @
80c33531
...
...
@@ -28,6 +28,7 @@ class WeakSetTests(unittest.TestCase):
self
.
assertEqual
(
dummy2
in
w
,
False
)
def
test_len
(
self
):
import
gc
w
=
WeakSet
()
d1
=
Dummy
()
d2
=
Dummy
()
...
...
@@ -35,6 +36,7 @@ class WeakSetTests(unittest.TestCase):
w
.
add
(
d2
)
self
.
assertEqual
(
len
(
w
),
2
)
del
d1
gc
.
collect
()
self
.
assertEqual
(
len
(
w
),
1
)
def
test_remove
(
self
):
...
...
@@ -46,6 +48,7 @@ class WeakSetTests(unittest.TestCase):
self
.
assertEqual
(
dummy
in
w
,
False
)
def
test_as_weakref_list
(
self
):
import
gc
w
=
WeakSet
()
dummy
=
Dummy
()
dummy2
=
Dummy
()
...
...
@@ -54,6 +57,7 @@ class WeakSetTests(unittest.TestCase):
w
.
add
(
dummy2
)
w
.
add
(
dummy3
)
del
dummy3
gc
.
collect
()
L
=
[
x
()
for
x
in
w
.
as_weakref_list
()]
# L is a list, but it does not have a guaranteed order.
self
.
assertTrue
(
list
,
type
(
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