summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-09-14 23:46:30 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-09-14 23:46:30 -0400
commitcdaaeeef2545f2911d495dabe4f603cac71aca07 (patch)
tree06655b91f9c2a9a04c2af98b3ff4dce573b1e7d7 /test
parent9d9e71c81e771d6ab1c25acff67edbeed705cd2f (diff)
downloadpython-coveragepy-cdaaeeef2545f2911d495dabe4f603cac71aca07.tar.gz
Capture the full path to the data file when execution starts. Fixes issue 24.
Diffstat (limited to 'test')
-rw-r--r--test/farm/run/run_chdir.py12
-rw-r--r--test/farm/run/src/chdir.py5
-rw-r--r--test/farm/run/src/subdir/placeholder0
3 files changed, 17 insertions, 0 deletions
diff --git a/test/farm/run/run_chdir.py b/test/farm/run/run_chdir.py
new file mode 100644
index 0000000..f459f50
--- /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 0000000..23c5afa
--- /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 0000000..e69de29
--- /dev/null
+++ b/test/farm/run/src/subdir/placeholder