summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_minidom.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-07-03 16:37:42 (GMT)
committerFred Drake <fdrake@acm.org>2000-07-03 16:37:42 (GMT)
commit17647f520192e18330401c4e242af98603dc3045 (patch)
tree352a7ae29e2eb06688e40afa7fb9aca8e002b67f /Lib/test/test_minidom.py
parent25e7cee1c88590d7cf23f0a0da02e08f238849a5 (diff)
downloadcpython-17647f520192e18330401c4e242af98603dc3045.zip
cpython-17647f520192e18330401c4e242af98603dc3045.tar.gz
cpython-17647f520192e18330401c4e242af98603dc3045.tar.bz2
Compute the name of the test file so that it can be found both when this
test is run as a script and when imported via the regression test framework. Problem reported by Phillip Porch <root@theporch.com>.
Diffstat (limited to 'Lib/test/test_minidom.py')
-rw-r--r--Lib/test/test_minidom.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py
index 4819bc6..73c8ac4 100644
--- a/Lib/test/test_minidom.py
+++ b/Lib/test/test_minidom.py
@@ -1,7 +1,17 @@
+# test for xml.dom.minidom
+
from xml.dom.minidom import parse, Node, Document, parseString
-import traceback, sys
-tstfile="test.xml"
+import os.path
+import sys
+import traceback
+
+if __name__ == "__main__":
+ base = sys.argv[0]
+else:
+ base = __file__
+tstfile = os.path.join(os.path.dirname(base), "test.xml")
+del base
Node._debug=1