diff Lib/test/test_normalization.py @ 28729:31cbd46f0c7d legacy-trunk

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.
author Fred Drake <fdrake@acm.org>
date Tue, 22 Apr 2003 18:15:05 +0000
parents 482ae055bbd4
children 90342f395721
line wrap: on
line diff
--- a/Lib/test/test_normalization.py	Tue Apr 22 15:39:09 2003 +0000
+++ b/Lib/test/test_normalization.py	Tue Apr 22 18:15:05 2003 +0000
@@ -4,7 +4,18 @@
 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