2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-20 16:52:15 +00:00
Files
python/example/test_abstract.py
Dave Abrahams 4328ae1d8d Updates for Boost.Build
[SVN r10403]
2001-06-22 22:36:00 +00:00

25 lines
649 B
Python

# Example by Ullrich Koethe
r'''>>> from abstract import *
>>> class A(Abstract):
... def __init__(self, text):
... Abstract.__init__(self) # call the base class constructor
... self.text = text
... def test(self): # implement abstract function
... return self.text
...
>>> a = A("Hello")
>>> a.test()
'Hello'
'''
def run(args = None):
if args is not None:
import sys
sys.argv = args
import doctest, test_abstract
return doctest.testmod(test_abstract)
if __name__ == '__main__':
import sys
sys.exit(run()[0])