Skip to content

Commit

Permalink
Fix dotted import tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thatbirdguythatuknownot authored Apr 25, 2024
1 parent 3a4ebb5 commit f0caedc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Lib/test/test_future_stmt/test_future.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,16 @@ def test_syntactical_future_repl(self):

def test_future_dotted_import(self):
with self.assertRaises(ImportError):
from .__future__ import annotations
exec("from .__future__ import spam")

with self.assertRaises(ImportError):
code = dedent(
"""
from __future__ import print_function
from ...__future__ import annotations
from ...__future__ import ham
"""
)
with self.assertRaises(ImportError):
exec(code)

code = """
from .__future__ import nested_scopes
Expand Down

0 comments on commit f0caedc

Please sign in to comment.