Commit 262899e7 authored by Tres Seaver's avatar Tres Seaver

Dropped dependency on 'zope.testing' / 'zope.testrunner'.

Tests now run with 'setup.py test'.
parent 177c8b08
``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.
......@@ -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()
))
......@@ -13,7 +13,6 @@
##############################################################################
import doctest
import unittest
from zope.testing import setupstack
def test_suite():
return unittest.TestSuite((
......
......@@ -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()
......@@ -11,29 +11,23 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
from persistent import Persistent
import unittest
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(),
))
))
......@@ -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()
......@@ -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()
......@@ -12,7 +12,7 @@
#
##############################################################################
__version__ = '3.11dev'
__version__ = '4.0dev'
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
"""
)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment