Skip to content

Commit

Permalink
Address review: remove xmltestdata/ dir
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed Jan 23, 2024
1 parent 13fdbc7 commit 4f8eaaa
Show file tree
Hide file tree
Showing 69 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Lib/test/decimaltestdata/*.decTest noeol
Lib/test/test_email/data/*.txt noeol
Lib/test/test_importlib/resources/data01/* noeol
Lib/test/test_importlib/resources/namespacedata01/* noeol
Lib/test/test_xml/xmltestdata/* noeol
Lib/test/test_xml/*.xml noeol

# Shell scripts should have LF even on Windows because of Cygwin
Lib/venv/scripts/common/activate text eol=lf
Expand Down
2 changes: 1 addition & 1 deletion Doc/license.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ W3C C14N test suite
-------------------

The C14N 2.0 test suite in the :mod:`test` package
(``Lib/test/test_xml/xmltestdata/c14n-20/``) was retrieved from the W3C website at
(``Lib/test/test_xml/c14n-20/``) was retrieved from the W3C website at
https://www.w3.org/TR/xml-c14n2-testcases/ and is distributed under the
3-clause BSD license::

Expand Down
2 changes: 0 additions & 2 deletions Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,8 +613,6 @@ def findfile(filename, subdir=None):
if os.path.isabs(filename):
return filename
if subdir is not None:
if not isinstance(subdir, str):
subdir = os.path.join(*subdir)
filename = os.path.join(subdir, filename)
path = [TEST_HOME_DIR] + sys.path
for dn in path:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion Lib/test/test_xml/test_minidom.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from xml.parsers.expat import ExpatError


tstfile = support.findfile("test.xml", subdir=("test_xml", "xmltestdata"))
tstfile = support.findfile("test.xml", subdir="test_xml")
sample = ("<?xml version='1.0' encoding='us-ascii'?>\n"
"<!DOCTYPE doc PUBLIC 'http://xml.python.org/public'"
" 'http://xml.python.org/system' [\n"
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_xml/test_pulldom.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from test.support import findfile


tstfile = findfile("test.xml", subdir=("test_xml", "xmltestdata"))
tstfile = findfile("test.xml", subdir="test_xml")

# A handy XML snippet, containing attributes, a namespace prefix, and a
# self-closing tag:
Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_xml/test_sax.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
from test.support.os_helper import FakePath, TESTFN


TEST_XMLFILE = findfile("test.xml", subdir=("test_xml", "xmltestdata"))
TEST_XMLFILE_OUT = findfile("test.xml.out", subdir=("test_xml", "xmltestdata"))
TEST_XMLFILE = findfile("test.xml", subdir="test_xml")
TEST_XMLFILE_OUT = findfile("test.xml.out", subdir="test_xml")
try:
TEST_XMLFILE.encode("utf-8")
TEST_XMLFILE_OUT.encode("utf-8")
Expand Down
10 changes: 5 additions & 5 deletions Lib/test/test_xml/test_xml_etree.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
pyET = None
ET = None

SIMPLE_XMLFILE = findfile("simple.xml", subdir=("test_xml", "xmltestdata"))
SIMPLE_XMLFILE = findfile("simple.xml", subdir="test_xml")
try:
SIMPLE_XMLFILE.encode("utf-8")
except UnicodeEncodeError:
raise unittest.SkipTest("filename is not encodable to utf8")
SIMPLE_NS_XMLFILE = findfile("simple-ns.xml", subdir=("test_xml", "xmltestdata"))
UTF8_BUG_XMLFILE = findfile("expat224_utf8_bug.xml", subdir=("test_xml", "xmltestdata"))
SIMPLE_NS_XMLFILE = findfile("simple-ns.xml", subdir="test_xml")
UTF8_BUG_XMLFILE = findfile("expat224_utf8_bug.xml", subdir="test_xml")

SAMPLE_XML = """\
<body>
Expand Down Expand Up @@ -4088,13 +4088,13 @@ def test_c14n_exclusion(self):

#
# basic method=c14n tests from the c14n 2.0 specification. uses
# test files under xmltestdata/c14n-20.
# test files under test_xml/c14n-20.

# note that this uses generated C14N versions of the standard ET.write
# output, not roundtripped C14N (see above).

def test_xml_c14n2(self):
datadir = findfile("c14n-20", subdir=("test_xml", "xmltestdata"))
datadir = findfile("c14n-20", subdir="test_xml")
full_path = partial(os.path.join, datadir)

files = [filename[:-4] for filename in sorted(os.listdir(datadir))
Expand Down
3 changes: 1 addition & 2 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -2318,8 +2318,7 @@ TESTSUBDIRS= idlelib/idle_test \
test/tracedmodules \
test/typinganndata \
test/test_xml \
test/test_xml/xmltestdata \
test/test_xml/xmltestdata/c14n-20
test/test_xml/c14n-20

COMPILEALL_OPTS=-j0

Expand Down

0 comments on commit 4f8eaaa

Please sign in to comment.