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 andreas_beyer_ext import * 6 >>> b=B() 7 >>> a=b.get() # let b create an A 8 >>> a2=b.get() 9 >>> assert id(a) == id(a2) 10 ''' 11 def run(args = None): 12 import sys 13 import doctest 14 15 if args is not None: 16 sys.argv = args 17 return doctest.testmod(sys.modules.get(__name__)) 18 19 if __name__ == '__main__': 20 print("running...") 21 import sys 22 status = run()[0] 23 if (status == 0): print("Done.") 24 sys.exit(status) 25