From: Fred Drake Date: Mon, 3 Jul 2000 16:37:42 +0000 (+0000) Subject: Compute the name of the test file so that it can be found both when this X-Git-Tag: v2.0b1~1107 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=17647f520192e18330401c4e242af98603dc3045;p=thirdparty%2FPython%2Fcpython.git 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 . --- diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py index 4819bc6d279b..73c8ac48e55a 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