Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
persistent
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
persistent
Commits
262899e7
Commit
262899e7
authored
May 14, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dropped dependency on 'zope.testing' / 'zope.testrunner'.
Tests now run with 'setup.py test'.
parent
177c8b08
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
32 additions
and
60 deletions
+32
-60
CHANGES.txt
CHANGES.txt
+4
-1
persistent/tests/test_PickleCache.py
persistent/tests/test_PickleCache.py
+3
-12
persistent/tests/test_mapping.py
persistent/tests/test_mapping.py
+0
-1
persistent/tests/test_overriding_attrs.py
persistent/tests/test_overriding_attrs.py
+1
-5
persistent/tests/test_persistent.py
persistent/tests/test_persistent.py
+10
-15
persistent/tests/test_pickle.py
persistent/tests/test_pickle.py
+8
-9
persistent/tests/test_wref.py
persistent/tests/test_wref.py
+1
-8
setup.py
setup.py
+5
-9
No files found.
CHANGES.txt
View file @
262899e7
``persistent`` Changelog
========================
3.11
(unreleased)
4.0
(unreleased)
-----------------
- Dropped dependency on ``zope.testing`` / ``zope.testrunner``: tests now
run with ``setup.py test``.
- Initial release, branched from ZODB trunk on 2011-02-16.
persistent/tests/test_PickleCache.py
View file @
262899e7
...
...
@@ -11,6 +11,7 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
import
unittest
class
DummyConnection
:
...
...
@@ -155,18 +156,8 @@ else:
"""
import
os
if
os
.
environ
.
get
(
'USE_ZOPE_TESTING_DOCTEST'
):
from
zope.testing.doctest
import
DocTestSuite
else
:
from
doctest
import
DocTestSuite
import
unittest
def
test_suite
():
from
doctest
import
DocTestSuite
return
unittest
.
TestSuite
((
DocTestSuite
(),
))
if
__name__
==
'__main__'
:
unittest
.
main
()
))
persistent/tests/test_mapping.py
View file @
262899e7
...
...
@@ -13,7 +13,6 @@
##############################################################################
import
doctest
import
unittest
from
zope.testing
import
setupstack
def
test_suite
():
return
unittest
.
TestSuite
((
...
...
persistent/tests/test_overriding_attrs.py
View file @
262899e7
...
...
@@ -377,9 +377,5 @@ class SampleOverridingGetattributeSetattrAndDelattr(Persistent):
def
test_suite
():
import
os
if
os
.
environ
.
get
(
'USE_ZOPE_TESTING_DOCTEST'
):
from
zope.testing.doctest
import
DocTestSuite
else
:
from
doctest
import
DocTestSuite
from
doctest
import
DocTestSuite
return
DocTestSuite
()
persistent/tests/test_persistent.py
View file @
262899e7
...
...
@@ -11,29 +11,23 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
from
persistent
import
Persisten
t
import
unittes
t
try
:
from
persistent
import
simple_new
except
ImportError
:
simple_new
=
None
import
os
if
os
.
environ
.
get
(
'USE_ZOPE_TESTING_DOCTEST'
):
from
zope.testing
import
doctest
else
:
import
doctest
import
unittest
class
P
(
Persistent
):
def
__init__
(
self
):
self
.
x
=
0
def
inc
(
self
):
self
.
x
+=
1
def
cpersistent_setstate_pointer_sanity
():
"""
>>> from persistent import Persistent
>>> class P(Persistent):
... def __init__(self):
... self.x = 0
... def inc(self):
... self.x += 1
>>>
>>> Persistent().__setstate__({})
Traceback (most recent call last):
...
...
...
@@ -56,7 +50,8 @@ if simple_new is not None:
"""
def
test_suite
():
import
doctest
return
unittest
.
TestSuite
((
doctest
.
DocFileSuite
(
"persistent.txt"
,
globs
=
{
"P"
:
P
}),
doctest
.
DocTestSuite
(),
))
))
persistent/tests/test_pickle.py
View file @
262899e7
...
...
@@ -11,8 +11,9 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
import
unittest
from
persistent
import
Persistent
import
pickle
def
print_dict
(
d
):
...
...
@@ -59,6 +60,7 @@ def test_basic_pickling():
>>> print_dict(state)
{'__name__': 'x', 'aaa': 1, 'bbb': 'foo'}
>>> import pickle
>>> pickle.loads(pickle.dumps(x)) == x
1
>>> pickle.loads(pickle.dumps(x, 0)) == x
...
...
@@ -110,6 +112,7 @@ def test_pickling_w_overrides():
>>> ax, ay, a
('x', 'y', 99)
>>> import pickle
>>> pickle.loads(pickle.dumps(x)) == x
1
>>> pickle.loads(pickle.dumps(x, 0)) == x
...
...
@@ -148,6 +151,7 @@ def test_pickling_w_slots_only():
>>> print_dict(s)
{'s1': 'x', 's2': 'y', 's3': 'z'}
>>> import pickle
>>> pickle.loads(pickle.dumps(x)) == x
1
>>> pickle.loads(pickle.dumps(x, 0)) == x
...
...
@@ -198,6 +202,7 @@ def test_pickling_w_slots():
>>> print_dict(s)
{'s1': 'x', 's2': 'y', 's3': 'z'}
>>> import pickle
>>> pickle.loads(pickle.dumps(x)) == x
1
>>> pickle.loads(pickle.dumps(x, 0)) == x
...
...
@@ -236,6 +241,7 @@ def test_pickling_w_slots_w_empty_dict():
>>> print_dict(s)
{'s1': 'x', 's2': 'y', 's3': 'z'}
>>> import pickle
>>> pickle.loads(pickle.dumps(x)) == x
1
>>> pickle.loads(pickle.dumps(x, 0)) == x
...
...
@@ -264,17 +270,10 @@ def test_pickling_w_slots_w_empty_dict():
"""
import
os
if
os
.
environ
.
get
(
'USE_ZOPE_TESTING_DOCTEST'
):
from
zope.testing.doctest
import
DocTestSuite
else
:
from
doctest
import
DocTestSuite
import
unittest
def
test_suite
():
from
doctest
import
DocTestSuite
return
unittest
.
TestSuite
((
DocTestSuite
(),
))
if
__name__
==
'__main__'
:
unittest
.
main
()
persistent/tests/test_wref.py
View file @
262899e7
...
...
@@ -12,13 +12,9 @@
#
##############################################################################
import
unittest
import
os
if
os
.
environ
.
get
(
'USE_ZOPE_TESTING_DOCTEST'
):
from
zope.testing.doctest
import
DocTestSuite
else
:
from
doctest
import
DocTestSuite
def
test_suite
():
from
doctest
import
DocTestSuite
try
:
import
transaction
import
ZODB
...
...
@@ -26,6 +22,3 @@ def test_suite():
return
unittest
.
TestSuite
()
else
:
return
DocTestSuite
(
'persistent.wref'
)
if
__name__
==
'__main__'
:
unittest
.
main
()
setup.py
View file @
262899e7
...
...
@@ -12,7 +12,7 @@
#
##############################################################################
__version__
=
'
3.11
dev'
__version__
=
'
4.0
dev'
import
os
...
...
@@ -24,9 +24,6 @@ from setuptools import find_packages
from
setuptools
import
setup
TESTS_REQUIRE
=
[
'zope.interface'
,
'zope.testing>=3.7.0'
,
'zope.testrunner'
,
]
here
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))
...
...
@@ -81,15 +78,14 @@ setup(name='persistent',
headers
=
[
'persistent/cPersistence.h'
,
'persistent/ring.h'
],
tests_require
=
TESTS_REQUIRE
,
extras_require
=
{
'test'
:
TESTS_REQUIRE
},
test_loader
=
"zope.testrunner.eggsupport:SkipLayers"
,
extras_require
=
{
'test'
:
TESTS_REQUIRE
,
},
test_suite
=
"persistent.tests"
,
install_requires
=
[
'zope.interface'
,
],
],
entry_points
=
"""
\
[distutils.commands]
ftest = zope.testrunner.eggsupport:ftest
"""
)
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