# HG changeset patch # User Jeff Hammel # Date 1310156627 25200 # Node ID d1f090c5f2913342de715d3d3bd2952d1b8dc644 # Parent aa673036ecc1a91c9cb2a2575e13b5286f8bcd6c lets make some more tests diff -r aa673036ecc1 -r d1f090c5f291 tests/doctest.txt --- a/tests/doctest.txt Fri Jul 08 13:10:20 2011 -0700 +++ b/tests/doctest.txt Fri Jul 08 13:23:47 2011 -0700 @@ -19,6 +19,18 @@ >>> os.listdir('.') ['foo.py'] +Invoke the foo.py it creates:: + + >>> import subprocess + >>> subprocess.call([python, 'foo.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + 0 + >>> sorted(os.listdir('.')) + ['foo', 'foo.py'] + >>> os.path.isdir('foo') + True + >>> sorted(os.listdir(os.path.join('foo', 'src'))) + ['packageA', 'packageB'] + Clean up:: >>> import shutil diff -r aa673036ecc1 -r d1f090c5f291 tests/test.py --- a/tests/test.py Fri Jul 08 13:10:20 2011 -0700 +++ b/tests/test.py Fri Jul 08 13:23:47 2011 -0700 @@ -17,7 +17,8 @@ # doctest arguments directory = os.path.dirname(os.path.abspath(__file__)) - extraglobs = {'here': directory} + extraglobs = {'here': directory, + 'python': sys.executable} doctest_args = dict(extraglobs=extraglobs, raise_on_error=raise_on_error) if report_first: doctest_args['optionflags'] = doctest.REPORT_ONLY_FIRST_FAILURE