summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Madden <jason+github@nextthought.com>2017-06-08 21:19:13 -0500
committerGitHub <noreply@github.com>2017-06-08 21:19:13 -0500
commit8bcfddcfbe8a597c7af0de191d51569fa1b1f603 (patch)
treef03c9d8edeecfae1980656399efd0c8a869bc245
parent47cf89eee7d43d6c268fb0fef4bbe0567d977ae4 (diff)
downloadzope-interface-8bcfddcfbe8a597c7af0de191d51569fa1b1f603.tar.gz
Test sanity cleanups (#88)
* Test sanity cleanups Partially addresses #87 - Remove manual lists of tests in favor of loadTestsFromName. This mostly gets all test runners running the same number of tests. - Remove `additional_tests`, which was just duplicating the discovered tests. No modern test runner seems to need it. - Change the two compatibility skip decorators to actually use unitetest skips, which helps with the reporting. * Per @tseaver, drop most test_suite functions. * Port remaining doctest to unittest. * Make the odd tests work on all supported python versions
-rw-r--r--.coveragerc3
-rw-r--r--.gitignore1
-rw-r--r--src/zope/interface/_compat.py23
-rw-r--r--src/zope/interface/common/tests/test_idatetime.py10
-rw-r--r--src/zope/interface/common/tests/test_import_interfaces.py17
-rw-r--r--src/zope/interface/tests/__init__.py14
-rw-r--r--src/zope/interface/tests/odd.py13
-rw-r--r--src/zope/interface/tests/test_adapter.py15
-rw-r--r--src/zope/interface/tests/test_advice.py11
-rw-r--r--src/zope/interface/tests/test_declarations.py33
-rw-r--r--src/zope/interface/tests/test_document.py7
-rw-r--r--src/zope/interface/tests/test_element.py12
-rw-r--r--src/zope/interface/tests/test_interface.py61
-rw-r--r--src/zope/interface/tests/test_interfaces.py9
-rw-r--r--src/zope/interface/tests/test_odd_declarations.py59
-rw-r--r--src/zope/interface/tests/test_registry.py10
-rw-r--r--src/zope/interface/tests/test_sorting.py14
-rw-r--r--src/zope/interface/tests/test_verify.py10
-rw-r--r--tox.ini4
19 files changed, 108 insertions, 218 deletions
diff --git a/.coveragerc b/.coveragerc
index a3bad53..5f09595 100644
--- a/.coveragerc
+++ b/.coveragerc
@@ -1,3 +1,6 @@
+[run]
+source = zope.interface
+
[report]
show_missing = true
exclude_lines =
diff --git a/.gitignore b/.gitignore
index 2beb925..f261c9d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,4 @@ eggs/
develop-eggs/
docs/_build/
parts/
+htmlcov/
diff --git a/src/zope/interface/_compat.py b/src/zope/interface/_compat.py
index 5f36574..b9c19dc 100644
--- a/src/zope/interface/_compat.py
+++ b/src/zope/interface/_compat.py
@@ -31,7 +31,7 @@ if sys.version_info[0] < 3: #pragma NO COVER
PYTHON3 = False
PYTHON2 = True
-else: #pragma NO COVER
+else: # pragma: no cover
def _normalize_name(name):
if isinstance(name, bytes):
@@ -48,16 +48,11 @@ else: #pragma NO COVER
PYTHON3 = True
PYTHON2 = False
-def _skip_under_py3k(test_method): #pragma NO COVER
- if sys.version_info[0] < 3:
- return test_method
- def _dummy(*args):
- pass
- return _dummy
-
-def _skip_under_py2(test_method): #pragma NO COVER
- if sys.version_info[0] > 2:
- return test_method
- def _dummy(*args):
- pass
- return _dummy
+def _skip_under_py3k(test_method): # pragma: no cover
+ import unittest
+ return unittest.skipIf(sys.version_info[0] >= 3, "Only on Python 2")(test_method)
+
+
+def _skip_under_py2(test_method): # pragma: no cover
+ import unittest
+ return unittest.skipIf(sys.version_info[0] < 3, "Only on Python 3")(test_method)
diff --git a/src/zope/interface/common/tests/test_idatetime.py b/src/zope/interface/common/tests/test_idatetime.py
index 60f377e..496a5c9 100644
--- a/src/zope/interface/common/tests/test_idatetime.py
+++ b/src/zope/interface/common/tests/test_idatetime.py
@@ -35,13 +35,3 @@ class TestDateTimeInterfaces(unittest.TestCase):
verifyClass(IDateClass, date)
verifyClass(IDateTimeClass, datetime)
verifyClass(ITimeClass, time)
-
-
-def test_suite():
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(TestDateTimeInterfaces))
- return suite
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/src/zope/interface/common/tests/test_import_interfaces.py b/src/zope/interface/common/tests/test_import_interfaces.py
index 908f05d..fe3766f 100644
--- a/src/zope/interface/common/tests/test_import_interfaces.py
+++ b/src/zope/interface/common/tests/test_import_interfaces.py
@@ -11,19 +11,10 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-import doctest
import unittest
-def test_interface_import():
- """
- >>> import zope.interface.common.interfaces
- """
-
-def test_suite():
- return unittest.TestSuite((
- doctest.DocTestSuite(),
- ))
-
-if __name__ == '__main__':
- unittest.main(defaultTest='test_suite')
+class TestInterfaceImport(unittest.TestCase):
+ def test_import(self):
+ import zope.interface.common.interfaces as x
+ self.assertIsNotNone(x)
diff --git a/src/zope/interface/tests/__init__.py b/src/zope/interface/tests/__init__.py
index 1cf24e6..15259c1 100644
--- a/src/zope/interface/tests/__init__.py
+++ b/src/zope/interface/tests/__init__.py
@@ -1,13 +1 @@
-import os
-import unittest
-
-def additional_tests():
- suites = unittest.TestSuite()
- for file in os.listdir(os.path.dirname(__file__)):
- if file.endswith('.py') and file!='__init__.py':
- name = os.path.splitext(file)[0]
- module = __import__('.'.join((__name__, name)), globals(),
- locals(), [name])
- if hasattr(module, 'test_suite'):
- suites.addTests(module.test_suite())
- return suites
+# Make this directory a package.
diff --git a/src/zope/interface/tests/odd.py b/src/zope/interface/tests/odd.py
index 04ffa31..18bca44 100644
--- a/src/zope/interface/tests/odd.py
+++ b/src/zope/interface/tests/odd.py
@@ -59,7 +59,7 @@ This is used for testing support for ExtensionClass in new interfaces.
>>> if sys.version[0] == '2': # This test only makes sense under Python 2.x
... from types import ClassType
... assert not isinstance(C, (type, ClassType))
-
+
>>> int(C.__class__.__class__ is C.__class__)
1
"""
@@ -72,12 +72,11 @@ class MetaMetaClass(type):
if name == '__class__':
return self
return type.__getattribute__(self, name)
-
+
class MetaClass(object):
"""Odd classes
"""
- __metaclass__ = MetaMetaClass
def __init__(self, name, bases, dict):
self.__name__ = name
@@ -97,6 +96,12 @@ class MetaClass(object):
def __repr__(self):
return "<odd class %s at %s>" % (self.__name__, hex(id(self)))
+
+MetaClass = MetaMetaClass('MetaClass',
+ MetaClass.__bases__,
+ {k: v for k, v in MetaClass.__dict__.items()
+ if k not in ('__dict__',)})
+
class OddInstance(object):
def __init__(self, cls):
@@ -120,7 +125,7 @@ class OddInstance(object):
def __repr__(self):
return "<odd %s instance at %s>" % (
self.__class__.__name__, hex(id(self)))
-
+
# DocTest:
diff --git a/src/zope/interface/tests/test_adapter.py b/src/zope/interface/tests/test_adapter.py
index fe1ca95..f1c1de5 100644
--- a/src/zope/interface/tests/test_adapter.py
+++ b/src/zope/interface/tests/test_adapter.py
@@ -1400,7 +1400,7 @@ class Test_utils(unittest.TestCase):
def test__normalize_name_unicode(self):
from zope.interface.adapter import _normalize_name
-
+
USTR = u'ustr'
self.assertEqual(_normalize_name(USTR), USTR)
@@ -1411,16 +1411,3 @@ class Test_utils(unittest.TestCase):
# _lookup, _lookupAll, and _subscriptions tested via their callers
# (AdapterLookupBase.{lookup,lookupAll,subscriptions}).
-
-
-def test_suite():
- return unittest.TestSuite((
- unittest.makeSuite(BaseAdapterRegistryTests),
- unittest.makeSuite(LookupBaseFallbackTests),
- unittest.makeSuite(LookupBaseTests),
- unittest.makeSuite(VerifyingBaseFallbackTests),
- unittest.makeSuite(VerifyingBaseTests),
- unittest.makeSuite(AdapterLookupBaseTests),
- unittest.makeSuite(AdapterRegistryTests),
- unittest.makeSuite(Test_utils),
- ))
diff --git a/src/zope/interface/tests/test_advice.py b/src/zope/interface/tests/test_advice.py
index 3d82de9..941cbef 100644
--- a/src/zope/interface/tests/test_advice.py
+++ b/src/zope/interface/tests/test_advice.py
@@ -372,14 +372,3 @@ class Test_minimalBases(unittest.TestCase):
class B(object):
pass
self.assertEqual(self._callFUT([A, B, A]), [B, A])
-
-
-
-def test_suite():
- return unittest.TestSuite((
- unittest.makeSuite(FrameInfoTest),
- unittest.makeSuite(AdviceTests),
- unittest.makeSuite(Test_isClassAdvisor),
- unittest.makeSuite(Test_determineMetaclass),
- unittest.makeSuite(Test_minimalBases),
- ))
diff --git a/src/zope/interface/tests/test_declarations.py b/src/zope/interface/tests/test_declarations.py
index 8e1ab9f..780ee18 100644
--- a/src/zope/interface/tests/test_declarations.py
+++ b/src/zope/interface/tests/test_declarations.py
@@ -1674,36 +1674,3 @@ class _MonkeyDict(object):
def __exit__(self, exc_type, exc_val, exc_tb):
self.target.clear()
self.target.update(self.to_restore)
-
-
-def test_suite():
- return unittest.TestSuite((
- unittest.makeSuite(DeclarationTests),
- unittest.makeSuite(TestImplements),
- unittest.makeSuite(Test_implementedByFallback),
- unittest.makeSuite(Test_implementedBy),
- unittest.makeSuite(Test_classImplementsOnly),
- unittest.makeSuite(Test_classImplements),
- unittest.makeSuite(Test__implements_advice),
- unittest.makeSuite(Test_implementer),
- unittest.makeSuite(Test_implementer_only),
- unittest.makeSuite(Test_implements),
- unittest.makeSuite(Test_implementsOnly),
- unittest.makeSuite(ProvidesClassTests),
- unittest.makeSuite(Test_Provides),
- unittest.makeSuite(Test_directlyProvides),
- unittest.makeSuite(Test_alsoProvides),
- unittest.makeSuite(Test_noLongerProvides),
- unittest.makeSuite(ClassProvidesBaseFallbackTests),
- unittest.makeSuite(ClassProvidesTests),
- unittest.makeSuite(Test_directlyProvidedBy),
- unittest.makeSuite(Test_classProvides),
- unittest.makeSuite(Test_provider),
- unittest.makeSuite(Test_moduleProvides),
- unittest.makeSuite(Test_getObjectSpecificationFallback),
- unittest.makeSuite(Test_getObjectSpecification),
- unittest.makeSuite(Test_providedByFallback),
- unittest.makeSuite(Test_providedBy),
- unittest.makeSuite(ObjectSpecificationDescriptorFallbackTests),
- unittest.makeSuite(ObjectSpecificationDescriptorTests),
- ))
diff --git a/src/zope/interface/tests/test_document.py b/src/zope/interface/tests/test_document.py
index 8163420..bffe6a2 100644
--- a/src/zope/interface/tests/test_document.py
+++ b/src/zope/interface/tests/test_document.py
@@ -503,10 +503,3 @@ class Test__justify_and_indent(unittest.TestCase):
" multiple lines.\n"
" ")
self.assertEqual(self._callFUT(TEXT, 1, munge=1, width=15), EXPECTED)
-
-def test_suite():
- return unittest.TestSuite((
- unittest.makeSuite(Test_asStructuredText),
- unittest.makeSuite(Test_asReStructuredText),
- unittest.makeSuite(Test__justify_and_indent),
- ))
diff --git a/src/zope/interface/tests/test_element.py b/src/zope/interface/tests/test_element.py
index 66724a6..eb003cd 100644
--- a/src/zope/interface/tests/test_element.py
+++ b/src/zope/interface/tests/test_element.py
@@ -22,20 +22,10 @@ class TestElement(unittest.TestCase):
def test_taggedValues(self):
"""Test that we can update tagged values of more than one element
"""
-
+
e1 = Element("foo")
e2 = Element("bar")
e1.setTaggedValue("x", 1)
e2.setTaggedValue("x", 2)
self.assertEqual(e1.getTaggedValue("x"), 1)
self.assertEqual(e2.getTaggedValue("x"), 2)
-
-
-def test_suite():
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(TestElement))
- return suite
-
-
-if __name__ == '__main__':
- unittest.main(defaultTest='test_suite')
diff --git a/src/zope/interface/tests/test_interface.py b/src/zope/interface/tests/test_interface.py
index 2b6f804..219f7d8 100644
--- a/src/zope/interface/tests/test_interface.py
+++ b/src/zope/interface/tests/test_interface.py
@@ -184,24 +184,24 @@ class SpecificationBasePyTests(unittest.TestCase):
def test_isOrExtends_miss(self):
sb = self._makeOne()
- sb._implied = {} # not defined by SpecificationBasePy
+ sb._implied = {} # not defined by SpecificationBasePy
self.assertFalse(sb.isOrExtends(object()))
def test_isOrExtends_hit(self):
sb = self._makeOne()
testing = object()
- sb._implied = {testing: {}} # not defined by SpecificationBasePy
+ sb._implied = {testing: {}} # not defined by SpecificationBasePy
self.assertTrue(sb(testing))
def test___call___miss(self):
sb = self._makeOne()
- sb._implied = {} # not defined by SpecificationBasePy
+ sb._implied = {} # not defined by SpecificationBasePy
self.assertFalse(sb.isOrExtends(object()))
def test___call___hit(self):
sb = self._makeOne()
testing = object()
- sb._implied = {testing: {}} # not defined by SpecificationBasePy
+ sb._implied = {testing: {}} # not defined by SpecificationBasePy
self.assertTrue(sb(testing))
@@ -836,7 +836,7 @@ class InterfaceClassTests(unittest.TestCase):
pass # Don't call base class.
derived = Derived()
with catch_warnings(record=True) as warned:
- warnings.simplefilter('always') # see LP #825249
+ warnings.simplefilter('always') # see LP #825249
self.assertEqual(hash(derived), 1)
self.assertEqual(len(warned), 1)
self.assertTrue(warned[0].category is UserWarning)
@@ -1086,7 +1086,7 @@ class InterfaceTests(unittest.TestCase):
from zope.interface import Attribute
from zope.interface import Interface
from zope.interface.verify import verifyClass
-
+
class ICheckMe(Interface):
attr = Attribute(u'My attr')
@@ -1107,7 +1107,7 @@ class InterfaceTests(unittest.TestCase):
from zope.interface import Attribute
from zope.interface import Interface
from zope.interface.verify import verifyObject
-
+
class ICheckMe(Interface):
attr = Attribute(u'My attr')
@@ -1137,7 +1137,7 @@ class InterfaceTests(unittest.TestCase):
def test_names_simple(self):
from zope.interface import Attribute
from zope.interface import Interface
-
+
class ISimple(Interface):
attr = Attribute(u'My attr')
@@ -1150,7 +1150,7 @@ class InterfaceTests(unittest.TestCase):
def test_names_derived(self):
from zope.interface import Attribute
from zope.interface import Interface
-
+
class IBase(Interface):
attr = Attribute(u'My attr')
@@ -1176,7 +1176,7 @@ class InterfaceTests(unittest.TestCase):
from zope.interface import Attribute
from zope.interface.interface import Method
from zope.interface import Interface
-
+
class ISimple(Interface):
attr = Attribute(u'My attr')
@@ -1200,7 +1200,7 @@ class InterfaceTests(unittest.TestCase):
from zope.interface import Attribute
from zope.interface import Interface
from zope.interface.interface import Method
-
+
class IBase(Interface):
attr = Attribute(u'My attr')
@@ -1265,7 +1265,7 @@ class InterfaceTests(unittest.TestCase):
from zope.interface import Attribute
from zope.interface.interface import Method
from zope.interface import Interface
-
+
class ISimple(Interface):
attr = Attribute(u'My attr')
@@ -1287,7 +1287,7 @@ class InterfaceTests(unittest.TestCase):
from zope.interface import Attribute
from zope.interface.interface import Method
from zope.interface import Interface
-
+
class IBase(Interface):
attr = Attribute(u'My attr')
@@ -1336,7 +1336,7 @@ class InterfaceTests(unittest.TestCase):
from zope.interface import Attribute
from zope.interface.interface import Method
from zope.interface import Interface
-
+
class ISimple(Interface):
attr = Attribute(u'My attr')
@@ -1358,7 +1358,7 @@ class InterfaceTests(unittest.TestCase):
from zope.interface import Attribute
from zope.interface.interface import Method
from zope.interface import Interface
-
+
class IBase(Interface):
attr = Attribute(u'My attr')
@@ -1406,7 +1406,7 @@ class InterfaceTests(unittest.TestCase):
def test___contains__simple(self):
from zope.interface import Attribute
from zope.interface import Interface
-
+
class ISimple(Interface):
attr = Attribute(u'My attr')
@@ -1420,7 +1420,7 @@ class InterfaceTests(unittest.TestCase):
def test___contains__derived(self):
from zope.interface import Attribute
from zope.interface import Interface
-
+
class IBase(Interface):
attr = Attribute(u'My attr')
@@ -1453,7 +1453,7 @@ class InterfaceTests(unittest.TestCase):
def test___iter__simple(self):
from zope.interface import Attribute
from zope.interface import Interface
-
+
class ISimple(Interface):
attr = Attribute(u'My attr')
@@ -1466,7 +1466,7 @@ class InterfaceTests(unittest.TestCase):
def test___iter__derived(self):
from zope.interface import Attribute
from zope.interface import Interface
-
+
class IBase(Interface):
attr = Attribute(u'My attr')
@@ -1707,7 +1707,7 @@ class InterfaceTests(unittest.TestCase):
class IRange(Interface):
min = Attribute("Lower bound")
max = Attribute("Upper bound")
-
+
@invariant
def range_invariant(ob):
if ob.max < ob.min:
@@ -2086,8 +2086,8 @@ def _barGreaterThanFoo(obj):
foo = getattr(obj, 'foo', None)
bar = getattr(obj, 'bar', None)
if foo is not None and isinstance(foo, type(bar)):
- # type checking should be handled elsewhere (like, say,
- # schema); these invariants should be intra-interface
+ # type checking should be handled elsewhere (like, say,
+ # schema); these invariants should be intra-interface
# constraints. This is a hacky way to do it, maybe, but you
# get the idea
if not bar > foo:
@@ -2113,20 +2113,3 @@ class _Monkey(object):
def __exit__(self, exc_type, exc_val, exc_tb):
for key, value in self.to_restore.items():
setattr(self.module, key, value)
-
-
-def test_suite():
- import doctest
- return unittest.TestSuite((
- unittest.makeSuite(ElementTests),
- unittest.makeSuite(SpecificationBasePyTests),
- unittest.makeSuite(InterfaceBasePyTests),
- unittest.makeSuite(SpecificationTests),
- unittest.makeSuite(InterfaceTests),
- unittest.makeSuite(AttributeTests),
- unittest.makeSuite(MethodTests),
- unittest.makeSuite(Test_fromFunction),
- #unittest.makeSuite(Test_fromMethod),
- doctest.DocTestSuite(),
- doctest.DocTestSuite("zope.interface.interface"),
- ))
diff --git a/src/zope/interface/tests/test_interfaces.py b/src/zope/interface/tests/test_interfaces.py
index 9c1b88e..285d857 100644
--- a/src/zope/interface/tests/test_interfaces.py
+++ b/src/zope/interface/tests/test_interfaces.py
@@ -93,12 +93,3 @@ class UnregisteredTests(unittest.TestCase,
from zope.interface.interfaces import IUnregistered
from zope.interface.verify import verifyObject
verifyObject(IUnregistered, self._makeOne())
-
-
-def test_suite():
- return unittest.TestSuite((
- unittest.makeSuite(ObjectEventTests),
- unittest.makeSuite(RegistrationEventTests),
- unittest.makeSuite(RegisteredTests),
- unittest.makeSuite(UnregisteredTests),
- ))
diff --git a/src/zope/interface/tests/test_odd_declarations.py b/src/zope/interface/tests/test_odd_declarations.py
index e508d1d..5480730 100644
--- a/src/zope/interface/tests/test_odd_declarations.py
+++ b/src/zope/interface/tests/test_odd_declarations.py
@@ -36,7 +36,10 @@ class I31(I3): pass
class I4(Interface): pass
class I5(Interface): pass
-class Odd(object): __metaclass__ = odd.MetaClass
+class Odd(object):
+ pass
+Odd = odd.MetaClass('Odd', Odd.__bases__, {})
+
class B(Odd): __implemented__ = I2
@@ -212,9 +215,51 @@ class Test(unittest.TestCase):
self.assertEqual([i.getName() for i in implementedBy(C2)],
['I3', 'I2'])
-def test_suite():
- import doctest
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(Test))
- suite.addTest(doctest.DocTestSuite(odd))
- return suite
+ def test_odd_metaclass_that_doesnt_subclass_type(self):
+ # This was originally a doctest in odd.py.
+ # It verifies that the metaclass the rest of these tests use
+ # works as expected.
+
+ # This is used for testing support for ExtensionClass in new interfaces.
+
+ class A(object):
+ a = 1
+
+ A = odd.MetaClass('A', A.__bases__, A.__dict__)
+
+ class B(object):
+ b = 1
+
+ B = odd.MetaClass('B', B.__bases__, B.__dict__)
+
+ class C(A, B):
+ pass
+
+ self.assertEqual(C.__bases__, (A, B))
+
+ a = A()
+ aa = A()
+ self.assertEqual(a.a, 1)
+ self.assertEqual(aa.a, 1)
+
+ aa.a = 2
+ self.assertEqual(a.a, 1)
+ self.assertEqual(aa.a, 2)
+
+ c = C()
+ self.assertEqual(c.a, 1)
+ self.assertEqual(c.b, 1)
+
+ c.b = 2
+ self.assertEqual(c.b, 2)
+
+ C.c = 1
+ self.assertEqual(c.c, 1)
+ c.c
+
+ import sys
+ if sys.version[0] == '2': # This test only makes sense under Python 2.x
+ from types import ClassType
+ assert not isinstance(C, (type, ClassType))
+
+ self.assertIs(C.__class__.__class__, C.__class__)
diff --git a/src/zope/interface/tests/test_registry.py b/src/zope/interface/tests/test_registry.py
index 970698b..de6f031 100644
--- a/src/zope/interface/tests/test_registry.py
+++ b/src/zope/interface/tests/test_registry.py
@@ -2650,13 +2650,3 @@ class _Monkey(object):
def __exit__(self, exc_type, exc_val, exc_tb):
for key, value in self.to_restore.items():
setattr(self.module, key, value)
-
-def test_suite():
- return unittest.TestSuite((
- unittest.makeSuite(ComponentsTests),
- unittest.makeSuite(UnhashableComponentsTests),
- unittest.makeSuite(UtilityRegistrationTests),
- unittest.makeSuite(AdapterRegistrationTests),
- unittest.makeSuite(SubscriptionRegistrationTests),
- unittest.makeSuite(AdapterRegistrationTests),
- ))
diff --git a/src/zope/interface/tests/test_sorting.py b/src/zope/interface/tests/test_sorting.py
index af60f88..73613d0 100644
--- a/src/zope/interface/tests/test_sorting.py
+++ b/src/zope/interface/tests/test_sorting.py
@@ -14,7 +14,7 @@
"""Test interface sorting
"""
-from unittest import TestCase, TestSuite, main, makeSuite
+import unittest
from zope.interface import Interface
@@ -26,7 +26,7 @@ class I5(I4): pass
class I6(I2): pass
-class Test(TestCase):
+class Test(unittest.TestCase):
def test(self):
l = [I1, I3, I5, I6, I4, I2]
@@ -37,7 +37,7 @@ class Test(TestCase):
l = [I1, None, I3, I5, I6, I4, I2]
l.sort()
self.assertEqual(l, [I1, I2, I3, I4, I5, I6, None])
-
+
def test_w_equal_names(self):
# interfaces with equal names but different modules should sort by
# module name
@@ -45,11 +45,3 @@ class Test(TestCase):
l = [I1, m1_I1]
l.sort()
self.assertEqual(l, [m1_I1, I1])
-
-def test_suite():
- return TestSuite((
- makeSuite(Test),
- ))
-
-if __name__=='__main__':
- main(defaultTest='test_suite')
diff --git a/src/zope/interface/tests/test_verify.py b/src/zope/interface/tests/test_verify.py
index d9c18d2..d1ef09e 100644
--- a/src/zope/interface/tests/test_verify.py
+++ b/src/zope/interface/tests/test_verify.py
@@ -559,13 +559,3 @@ class Test_verifyObject(Test_verifyClass):
class OldSkool:
pass
-
-def test_suite():
- #import doctest
- return unittest.TestSuite((
- unittest.makeSuite(Test_verifyClass),
- unittest.makeSuite(Test_verifyObject),
- # This one needs to turn into just docs.
- #doctest.DocFileSuite('../verify.txt',
- # optionflags=doctest.NORMALIZE_WHITESPACE),
- ))
diff --git a/tox.ini b/tox.ini
index 9394f2b..e006ebb 100644
--- a/tox.ini
+++ b/tox.ini
@@ -4,7 +4,7 @@ envlist =
[testenv]
commands =
- python setup.py -q test -q
+ python setup.py -q test -q {posargs}
deps =
zope.event
@@ -28,7 +28,7 @@ usedevelop = true
basepython =
python2.7
commands =
- nosetests --with-xunit --with-xcoverage
+ nosetests --with-xunit --with-xcoverage {posargs}
deps =
{[testenv]deps}
nose