const_argument.py 575 B

1234567891011121314151617181920212223
  1. # Copyright Jonathan Brandmeyer, 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 const_argument_ext import *
  6. >>> accept_const_arg(1)
  7. 1
  8. """
  9. def run(args = None):
  10. import sys
  11. import doctest
  12. if args is not None:
  13. sys.argv = args
  14. return doctest.testmod(sys.modules.get(__name__))
  15. if __name__ == '__main__':
  16. print("running...")
  17. import sys
  18. status = run()[0]
  19. if (status == 0): print("Done.")
  20. sys.exit(status)