summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2003-04-22 18:15:05 (GMT)
committerFred Drake <fdrake@acm.org>2003-04-22 18:15:05 (GMT)
commitb28271f24d23d3c3ba861715d5af4f7669f20a0c (patch)
tree32b60852b73aa4b609c084a6d3bbf3c19b3aafa8
parent3c9068bbec1f237feec96aaad64a6c73fa95bf8b (diff)
downloadcpython-b28271f24d23d3c3ba861715d5af4f7669f20a0c.zip
cpython-b28271f24d23d3c3ba861715d5af4f7669f20a0c.tar.gz
cpython-b28271f24d23d3c3ba861715d5af4f7669f20a0c.tar.bz2
Do a little more searching for the data file for the test: this allows
using a build directory just inside the source directory and saving just one copy of the test data in the source tree, rather than having a copy in each build directory.
-rw-r--r--Lib/test/test_normalization.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/Lib/test/test_normalization.py b/Lib/test/test_normalization.py
index 7e18c97..94d07d5 100644
--- a/Lib/test/test_normalization.py
+++ b/Lib/test/test_normalization.py
@@ -4,7 +4,18 @@ import os
from unicodedata import normalize
TESTDATAFILE = "NormalizationTest.txt"
-skip_expected = not os.path.exists(TESTDATAFILE)
+
+# This search allows using a build directory just inside the source
+# directory, and saving just one copy of the test data in the source
+# tree, rather than having a copy in each build directory.
+# There might be a better way to do this.
+
+for path in [os.path.curdir, os.path.pardir]:
+ fn = os.path.join(path, TESTDATAFILE)
+ skip_expected = not os.path.exists(fn)
+ if not skip_expected:
+ TESTDATAFILE = fn
+ break
class RangeError:
pass