[3.11] gh-108303: Fix and move `badsyntax_pep3120.py` (GH-109513) by sobolevn · Pull Request #109724 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Lib/test/.ruff.toml
8 changes: 5 additions & 3 deletions Lib/test/test_imp.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_find_module_encoding(self):
with imp.find_module('module_' + mod, self.test_path)[0] as fd:
self.assertEqual(fd.encoding, encoding)

path = [os.path.dirname(__file__)]
path = [os.path.join(os.path.dirname(__file__), 'tokenizedata')]
with self.assertRaises(SyntaxError):
imp.find_module('badsyntax_pep3120', path)

Expand Down Expand Up @@ -203,9 +203,11 @@ def test_issue5604(self):
os_helper.rmtree('__pycache__')

def test_issue9319(self):
path = os.path.dirname(__file__)
path = os.path.join(os.path.dirname(__file__), "tokenizedata")
self.assertRaises(SyntaxError,
imp.find_module, "badsyntax_pep3120", [path])
imp.find_module,
"badsyntax_pep3120",
[path])

def test_load_from_source(self):
# Verify that the imp module can correctly load and find .py files
Expand Down
4 changes: 1 addition & 3 deletions Lib/test/test_utf8source.py