Skip to content

Commit 3e718cf

Browse files
authored
gh-95218: Move tests for importlib.resources into test_importlib.resources. (#95219)
* gh-95218: Move tests for importlib.resources into test_importlib.resources. * Also update makefile * Include test_importlib/resources in code ownership rule.
1 parent 9007dec commit 3e718cf

36 files changed

+25
-24
lines changed

.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ Lib/test/cjkencodings/* noeol
2828
Lib/test/coding20731.py noeol
2929
Lib/test/decimaltestdata/*.decTest noeol
3030
Lib/test/test_email/data/*.txt noeol
31-
Lib/test/test_importlib/data01/* noeol
32-
Lib/test/test_importlib/namespacedata01/* noeol
31+
Lib/test/test_importlib/resources/data01/* noeol
32+
Lib/test/test_importlib/resources/namespacedata01/* noeol
3333
Lib/test/xmltestdata/* noeol
3434

3535
# CRLF files

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Python/pythonrun.c @iritkatriel
6161
# bytecode.
6262
**/*import*.c @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
6363
**/*import*.py @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
64-
**/importlib/resources/* @jaraco @warsaw @brettcannon
64+
**/*importlib/resources/* @jaraco @warsaw @brettcannon
6565
**/importlib/metadata/* @jaraco @warsaw
6666

6767
# Dates and times

Lib/test/test_importlib/test_compatibilty_files.py renamed to Lib/test/test_importlib/resources/test_compatibilty_files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
wrap_spec,
99
)
1010

11-
from .resources import util
11+
from . import util
1212

1313

1414
class CompatibilityFilesTests(unittest.TestCase):

Lib/test/test_importlib/test_contents.py renamed to Lib/test/test_importlib/resources/test_contents.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from importlib import resources
33

44
from . import data01
5-
from .resources import util
5+
from . import util
66

77

88
class ContentsTests:

Lib/test/test_importlib/test_files.py renamed to Lib/test/test_importlib/resources/test_files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from importlib import resources
55
from importlib.abc import Traversable
66
from . import data01
7-
from .resources import util
7+
from . import util
88

99

1010
class FilesTests:

Lib/test/test_importlib/test_open.py renamed to Lib/test/test_importlib/resources/test_open.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from importlib import resources
44
from . import data01
5-
from .resources import util
5+
from . import util
66

77

88
class CommonBinaryTests(util.CommonTests, unittest.TestCase):

Lib/test/test_importlib/test_path.py renamed to Lib/test/test_importlib/resources/test_path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from importlib import resources
55
from . import data01
6-
from .resources import util
6+
from . import util
77

88

99
class CommonTests(util.CommonTests, unittest.TestCase):

Lib/test/test_importlib/test_read.py renamed to Lib/test/test_importlib/resources/test_read.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from importlib import import_module, resources
44
from . import data01
5-
from .resources import util
5+
from . import util
66

77

88
class CommonBinaryTests(util.CommonTests, unittest.TestCase):

Lib/test/test_importlib/test_resource.py renamed to Lib/test/test_importlib/resources/test_resource.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from . import data01
77
from . import zipdata01, zipdata02
8-
from .resources import util
8+
from . import util
99
from importlib import resources, import_module
1010
from test.support import import_helper
1111
from test.support.os_helper import unlink

Lib/test/test_importlib/resources/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import types
66
from pathlib import Path, PurePath
77

8-
from .. import data01
9-
from .. import zipdata01
8+
from . import data01
9+
from . import zipdata01
1010
from importlib.abc import ResourceReader
1111
from test.support import import_helper
1212

Makefile.pre.in

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1926,15 +1926,6 @@ TESTSUBDIRS= distutils/tests \
19261926
test/test_importlib \
19271927
test/test_importlib/builtin \
19281928
test/test_importlib/data \
1929-
test/test_importlib/data01 \
1930-
test/test_importlib/data01/subdirectory \
1931-
test/test_importlib/data02 \
1932-
test/test_importlib/data02/one \
1933-
test/test_importlib/data02/two \
1934-
test/test_importlib/data03 \
1935-
test/test_importlib/data03/namespace \
1936-
test/test_importlib/data03/namespace/portion1 \
1937-
test/test_importlib/data03/namespace/portion2 \
19381929
test/test_importlib/extension \
19391930
test/test_importlib/frozen \
19401931
test/test_importlib/import_ \
@@ -1958,12 +1949,21 @@ TESTSUBDIRS= distutils/tests \
19581949
test/test_importlib/namespace_pkgs/project3 \
19591950
test/test_importlib/namespace_pkgs/project3/parent \
19601951
test/test_importlib/namespace_pkgs/project3/parent/child \
1961-
test/test_importlib/namespacedata01 \
19621952
test/test_importlib/partial \
19631953
test/test_importlib/resources \
1954+
test/test_importlib/resources/data01 \
1955+
test/test_importlib/resources/data01/subdirectory \
1956+
test/test_importlib/resources/data02 \
1957+
test/test_importlib/resources/data02/one \
1958+
test/test_importlib/resources/data02/two \
1959+
test/test_importlib/resources/data03 \
1960+
test/test_importlib/resources/data03/namespace \
1961+
test/test_importlib/resources/data03/namespace/portion1 \
1962+
test/test_importlib/resources/data03/namespace/portion2 \
1963+
test/test_importlib/resources/namespacedata01 \
1964+
test/test_importlib/resources/zipdata01 \
1965+
test/test_importlib/resources/zipdata02 \
19641966
test/test_importlib/source \
1965-
test/test_importlib/zipdata01 \
1966-
test/test_importlib/zipdata02 \
19671967
test/test_json \
19681968
test/test_lib2to3 \
19691969
test/test_lib2to3/data \
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Move tests for importlib.resources into test_importlib.resources.

0 commit comments

Comments
 (0)