Skip to content

Commit

Permalink
basic tests
Browse files Browse the repository at this point in the history
  • Loading branch information
noklam committed Feb 2, 2025
1 parent 07e8f50 commit fe637e0
Show file tree
Hide file tree
Showing 9 changed files with 445 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

400 changes: 400 additions & 0 deletions .idea/dbnavigator.xml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .idea/learn-rust-by-building-ruff.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/ruff_in_python/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ def pretty_print_ast(self):
ast.Module.__repr__ = pretty_print_ast


def parse(path: Path):
def parse_file(path: Path):
with open(path) as f:
return ast.parse(f.read())
6 changes: 3 additions & 3 deletions tests/test_parse.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import ast
from ruff_in_python.parser import parse
from ruff_in_python.parser import parse_file


def test_parser():
stmt = "print(123)"
res = parse(stmt)
stmt = "tests/foo.py"
res = parse_file(stmt)
assert isinstance(res, ast.Module)

0 comments on commit fe637e0

Please sign in to comment.