bienstman3.py 702 B

123456789101112131415161718192021222324252627282930
  1. # Copyright David Abrahams 2004. Distributed under the Boost
  2. # Software License, Version 1.0. (See accompanying
  3. # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. '''
  5. >>> from bienstman3_ext import *
  6. >>> try:
  7. ... V()
  8. ... except RuntimeError as x:
  9. ... print(x)
  10. ... else:
  11. ... print('expected an exception')
  12. ...
  13. This class cannot be instantiated from Python
  14. '''
  15. def run(args = None):
  16. import sys
  17. import doctest
  18. if args is not None:
  19. sys.argv = args
  20. return doctest.testmod(sys.modules.get(__name__))
  21. if __name__ == '__main__':
  22. print("running...")
  23. import sys
  24. status = run()[0]
  25. if (status == 0): print("Done.")
  26. sys.exit(status)