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
commita9ba8f4278072e87d1303493cc67fc1a6b3c876a (patch)
treef7492db057ae94ebc058d4d8d1e7d4dbdc38b0d3 /test
parenta6ed04580549e284dee3645724da6b7b0c4a8ac6 (diff)
downloadpython-coveragepy-git-a9ba8f4278072e87d1303493cc67fc1a6b3c876a.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 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
--- /dev/null
+++ b/test/farm/run/src/subdir/placeholder