Akira Li added the comment:
About the name: abstract_tests could be used e.g.:
@abstract_tests
class AbcSetTests(TestCase):
# test abc.Set
Set = abstract_property()
def setUp(self):
self.set = self.Set('abc')
def test_difference(self):
self.assert...
def test_union(self):
self.assert...
It is clear that AbcSetTests do not run because the class is abstract
(can't create an instance). It is clear that to create a concrete test,
you need to subclass the abstract class (serve as a base class):
class BuiltinSetTests(AbcSetTests):
# test builtins.set
Set = set
class FrozenSetTests(AbcSetTests):
# test frozenset
Set = frozenset
It might not be necessary to enforce all abstract constraints in the
implementation initially. The only thing that needs to be implemented is
that tests from @abstract_tests decorated class should not be run.
----------
nosy: +akira
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue14534>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com