@@ -19,8 +19,8 @@ def setUp(self) -> None:
19
19
os .path .join (data_path , "nsx-pkg3" ),
20
20
os .path .join (data_path , "nsy-pkg1" ),
21
21
os .path .join (data_path , "nsy-pkg2" ),
22
- os .path .join (data_path , "pkg4 " ),
23
- os .path .join (data_path , "pkg5 " ),
22
+ os .path .join (data_path , "pkg1 " ),
23
+ os .path .join (data_path , "pkg2 " ),
24
24
),
25
25
package_path = (),
26
26
typeshed_path = (),
@@ -47,17 +47,17 @@ def test__no_namespace_packages__nsx_a(self) -> None:
47
47
found_module = self .fmc_nons .find_module ("nsx.a" )
48
48
self .assertIsNone (found_module )
49
49
50
- def test__no_namespace_packages__find_a_in_pkg4 (self ) -> None :
50
+ def test__no_namespace_packages__find_a_in_pkg1 (self ) -> None :
51
51
"""
52
- Find find pkg4 /a.py for "a" with namespace_packages False.
52
+ Find find pkg1 /a.py for "a" with namespace_packages False.
53
53
"""
54
54
found_module = self .fmc_nons .find_module ("a" )
55
- expected = os .path .join (data_path , "pkg4 " , "a.py" )
55
+ expected = os .path .join (data_path , "pkg1 " , "a.py" )
56
56
assert_equal (expected , found_module )
57
57
58
- def test__no_namespace_packages__find_b_in_pkg5 (self ) -> None :
58
+ def test__no_namespace_packages__find_b_in_pkg2 (self ) -> None :
59
59
found_module = self .fmc_ns .find_module ("b" )
60
- expected = os .path .join (data_path , "pkg5 " , "b" , "__init__.py" )
60
+ expected = os .path .join (data_path , "pkg2 " , "b" , "__init__.py" )
61
61
assert_equal (expected , found_module )
62
62
63
63
def test__find_nsx_as_namespace_pkg_in_pkg1 (self ) -> None :
@@ -70,23 +70,32 @@ def test__find_nsx_as_namespace_pkg_in_pkg1(self) -> None:
70
70
assert_equal (expected , found_module )
71
71
72
72
def test__find_nsx_a_init_in_pkg1 (self ) -> None :
73
+ """
74
+ Find nsx-pkg1/nsx/a/__init__.py for "nsx.a" in namespace mode.
75
+ """
73
76
found_module = self .fmc_ns .find_module ("nsx.a" )
74
77
expected = os .path .join (data_path , "nsx-pkg1" , "nsx" , "a" , "__init__.py" )
75
78
assert_equal (expected , found_module )
76
79
77
80
def test__find_nsx_b_init_in_pkg2 (self ) -> None :
81
+ """
82
+ Find nsx-pkg2/nsx/b/__init__.py for "nsx.b" in namespace mode.
83
+ """
78
84
found_module = self .fmc_ns .find_module ("nsx.b" )
79
85
expected = os .path .join (data_path , "nsx-pkg2" , "nsx" , "b" , "__init__.py" )
80
86
assert_equal (expected , found_module )
81
87
82
88
def test__find_nsx_c_c_in_pkg3 (self ) -> None :
89
+ """
90
+ Find nsx-pkg3/nsx/c/c.py for "nsx.c.c" in namespace mode.
91
+ """
83
92
found_module = self .fmc_ns .find_module ("nsx.c.c" )
84
93
expected = os .path .join (data_path , "nsx-pkg3" , "nsx" , "c" , "c.py" )
85
94
assert_equal (expected , found_module )
86
95
87
96
def test__find_nsy_a__init_pyi (self ) -> None :
88
97
"""
89
- Prefer a __init__.pyi file over a __init__.py
98
+ Prefer nsy-pkg1/a/ __init__.pyi file over __init__.py.
90
99
"""
91
100
found_module = self .fmc_ns .find_module ("nsy.a" )
92
101
expected = os .path .join (data_path , "nsy-pkg1" , "nsy" , "a" , "__init__.pyi" )
@@ -112,14 +121,14 @@ def test__find_nsy_c_pyi(self) -> None:
112
121
expected = os .path .join (data_path , "nsy-pkg2" , "nsy" , "c.pyi" )
113
122
assert_equal (expected , found_module )
114
123
115
- def test__find_a_in_pkg4 (self ) -> None :
124
+ def test__find_a_in_pkg1 (self ) -> None :
116
125
found_module = self .fmc_ns .find_module ("a" )
117
- expected = os .path .join (data_path , "pkg4 " , "a.py" )
126
+ expected = os .path .join (data_path , "pkg1 " , "a.py" )
118
127
assert_equal (expected , found_module )
119
128
120
- def test__find_b_init_in_pkg5 (self ) -> None :
129
+ def test__find_b_init_in_pkg2 (self ) -> None :
121
130
found_module = self .fmc_ns .find_module ("b" )
122
- expected = os .path .join (data_path , "pkg5 " , "b" , "__init__.py" )
131
+ expected = os .path .join (data_path , "pkg2 " , "b" , "__init__.py" )
123
132
assert_equal (expected , found_module )
124
133
125
134
def test__find_d_nowhere (self ) -> None :
0 commit comments