Skip to content

Commit

Permalink
Add missing import test
Browse files Browse the repository at this point in the history
  • Loading branch information
evhub committed Aug 6, 2023
1 parent 7d95dc1 commit 6473ac8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions coconut/tests/src/extras.coco
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,16 @@ else:
assert_raises(-> parse("def x -> pass, 1"), CoconutStyleError, err_has="statement lambda")
assert_raises(-> parse("abc = f'abc'"), CoconutStyleError, err_has="\n ^")
assert_raises(-> parse('f"{f"{f"infinite"}"}"'), CoconutStyleError, err_has=" ^~~~~~~~~~~|")
try:
parse("""
import abc
1
2
3
""".strip())
except CoconutStyleError as err:
assert str(err) == """found unused import 'abc' (add '# NOQA' to suppress) (remove --strict to downgrade to a warning) (line 1)
import abc"""

setup(line_numbers=False, strict=True, target="sys")
assert_raises(-> parse("await f x"), CoconutParseError, err_has='invalid use of the keyword "await"')
Expand Down

0 comments on commit 6473ac8

Please sign in to comment.