From a9ba8f4278072e87d1303493cc67fc1a6b3c876a Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 14 Sep 2009 23:46:30 -0400 Subject: Capture the full path to the data file when execution starts. Fixes issue 24. --- test/farm/run/run_chdir.py | 12 ++++++++++++ test/farm/run/src/chdir.py | 5 +++++ test/farm/run/src/subdir/placeholder | 0 3 files changed, 17 insertions(+) create mode 100644 test/farm/run/run_chdir.py create mode 100644 test/farm/run/src/chdir.py create mode 100644 test/farm/run/src/subdir/placeholder (limited to 'test') diff --git a/test/farm/run/run_chdir.py b/test/farm/run/run_chdir.py new file mode 100644 index 00000000..f459f500 --- /dev/null +++ b/test/farm/run/run_chdir.py @@ -0,0 +1,12 @@ +copy("src", "out") +run(""" + coverage run chdir.py + coverage -r + """, rundir="out", outfile="stdout.txt") +contains("out/stdout.txt", + "Line One", + "Line Two", + "chdir" + ) +doesnt_contain("out/stdout.txt", "No such file or directory") +clean("out") diff --git a/test/farm/run/src/chdir.py b/test/farm/run/src/chdir.py new file mode 100644 index 00000000..23c5afa8 --- /dev/null +++ b/test/farm/run/src/chdir.py @@ -0,0 +1,5 @@ +import os +print "Line One" +os.chdir("subdir") +print "Line Two" + diff --git a/test/farm/run/src/subdir/placeholder b/test/farm/run/src/subdir/placeholder new file mode 100644 index 00000000..e69de29b -- cgit v1.2.1