bpo-38937: add test
This commit is contained in:
parent
49282fd672
commit
86a32cf12d
|
@ -167,6 +167,14 @@ class HelperFunctionsTests(unittest.TestCase):
|
||||||
if isinstance(path, str):
|
if isinstance(path, str):
|
||||||
self.assertNotIn("abc\x00def", path)
|
self.assertNotIn("abc\x00def", path)
|
||||||
|
|
||||||
|
def test_pth_exc_namespacing(self):
|
||||||
|
# Issue 38937
|
||||||
|
contents = "import sys; x = 5; [print(x + i) for i in range(5)]\n"
|
||||||
|
pth_dir, pth_fn = self.make_pth(contents)
|
||||||
|
with captured_stderr() as err_out:
|
||||||
|
self.assertFalse(site.addpackage(pth_dir, pth_fn, set()))
|
||||||
|
self.assertEqual(err_out.getvalue(), "")
|
||||||
|
|
||||||
def test_addsitedir(self):
|
def test_addsitedir(self):
|
||||||
# Same tests for test_addpackage since addsitedir() essentially just
|
# Same tests for test_addpackage since addsitedir() essentially just
|
||||||
# calls addpackage() for every .pth file in the directory
|
# calls addpackage() for every .pth file in the directory
|
||||||
|
|
Loading…
Reference in New Issue