[Checkins] SVN: zope.interface/trunk/src/zope/interface/tests/test_declarations.py Scrub trailing ws, use canonical suite-generation form.
Tres Seaver
tseaver at palladion.com
Tue Apr 13 16:33:32 EDT 2010
Log message for revision 110827:
Scrub trailing ws, use canonical suite-generation form.
Changed:
U zope.interface/trunk/src/zope/interface/tests/test_declarations.py
-=-
Modified: zope.interface/trunk/src/zope/interface/tests/test_declarations.py
===================================================================
--- zope.interface/trunk/src/zope/interface/tests/test_declarations.py 2010-04-13 19:43:15 UTC (rev 110826)
+++ zope.interface/trunk/src/zope/interface/tests/test_declarations.py 2010-04-13 20:33:31 UTC (rev 110827)
@@ -40,10 +40,10 @@
class COnly_old(A, B):
__implemented__ = I3
-
+
class D(COnly):
implements(I5)
-
+
def test_ObjectSpecification_Simple():
"""
>>> c = C()
@@ -123,7 +123,7 @@
intspec = implementedBy(int)
olddeclared = intspec.declared
-
+
classImplements(int, I1)
class myint(int):
implements(I2)
@@ -144,8 +144,8 @@
x = 42
self.assertEqual([i.getName() for i in providedBy(x)],
[])
-
+
def test_signature_w_no_class_interfaces():
"""
>>> from zope.interface import *
@@ -154,7 +154,7 @@
>>> c = C()
>>> list(providedBy(c))
[]
-
+
>>> class I(Interface):
... pass
>>> directlyProvides(c, I)
@@ -195,7 +195,7 @@
>>> a2 = loads(dumps(a))
>>> I2.providedBy(a2)
1
-
+
"""
def test_that_we_dont_inherit_class_provides():
@@ -211,7 +211,7 @@
Traceback (most recent call last):
...
AttributeError: __provides__
-
+
"""
def test_that_we_dont_inherit_provides_optimizations():
@@ -220,7 +220,7 @@
When we make a declaration for a class, we install a __provides__
descriptors that provides a default for instances that don't have
instance-specific declarations:
-
+
>>> class A(object):
... implements(I1)
@@ -251,10 +251,10 @@
then the optimization will work:
-
+
>>> [i.__name__ for i in X().__provides__]
['I1', 'I2']
-
+
"""
def test_classProvides_before_implements():
@@ -401,8 +401,8 @@
>>> import pickle
>>> pickle.loads(pickle.dumps(implementedBy(C))) is implementedBy(C)
True
-
-
+
+
"""
def test_provided_by_with_slots():
@@ -422,15 +422,9 @@
"""
-
def test_suite():
- suite = unittest.TestSuite()
- suite.addTest(unittest.makeSuite(Test))
- suite.addTest(doctest.DocTestSuite("zope.interface.declarations"))
- suite.addTest(doctest.DocTestSuite())
-
- return suite
-
-
-if __name__ == '__main__':
- unittest.main()
+ return unittest.TestSuite((
+ unittest.makeSuite(Test),
+ doctest.DocTestSuite("zope.interface.declarations"),
+ doctest.DocTestSuite(),
+ ))
More information about the checkins
mailing list