Skip to content

Commit

Permalink
Fix test for libcst 1.0 and native parser
Browse files Browse the repository at this point in the history
  • Loading branch information
amyreese committed May 31, 2023
1 parent e93b8b1 commit d72adf0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ python_requires = >=3.6
install_requires =
attrs >= 21.2.0
click >= 7.0.0
LibCST >= 0.3.7, < 1.0
LibCST >= 0.3.7
moreorless >= 0.3.0
stdlibs >= 2021.4.1
toml >= 0.10.0
Expand Down
4 changes: 2 additions & 2 deletions usort/tests/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def test_format_parse_error(self) -> None:

self.assertRegex(
result.output,
r"Error sorting sample\.py: Syntax Error @ 1:7\.",
r"Error sorting sample\.py: Syntax Error @ 1:",
)
self.assertEqual(result.exit_code, 1)

Expand All @@ -242,7 +242,7 @@ def test_format_parse_error_conflicting_syntax(self) -> None:

self.assertRegex(
result.output,
r"Error sorting sample\.py: Syntax Error @ 2:11\.",
r"Error sorting sample\.py: Syntax Error @ 2:",
)
self.assertEqual(result.exit_code, 1)

Expand Down
3 changes: 2 additions & 1 deletion usort/tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# LICENSE file in the root directory of this source tree.

import unittest
from typing import Sequence

import libcst as cst

Expand Down Expand Up @@ -31,7 +32,7 @@ def test_parse_import_from(self) -> None:
cst.ImportFrom,
)
self.assertEqual(cst.ensure_type(inner.module, cst.Name).value, "a")
assert isinstance(inner.names, list)
assert isinstance(inner.names, Sequence), f"{type(inner.names)} is not Sequence"
name = inner.names[0]
self.assertEqual(
cst.ensure_type(
Expand Down

0 comments on commit d72adf0

Please sign in to comment.