Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra committed Sep 8, 2023
1 parent 22dfe4f commit 4aca4b3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
8 changes: 0 additions & 8 deletions tests/data/preview/pep_572.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
x[a:=0]
x[a := 0]
x[a := 0, b := 1]
x[5, b := 0]
x[(a:=0):]
x[:(a:=0)]

# output
x[a := 0]
x[a := 0]
x[a := 0, b := 1]
x[5, b := 0]
x[(a := 0):]
x[:(a := 0)]
12 changes: 12 additions & 0 deletions tests/data/preview_py_310/pep_572.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
x[a:=0]
x[a := 0]
x[a := 0, b := 1]
x[5, b := 0]
x[a:=0,b:=1]

# output
x[a := 0]
x[a := 0]
x[a := 0, b := 1]
x[5, b := 0]
x[a := 0, b := 1]
7 changes: 7 additions & 0 deletions tests/test_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ def test_preview_context_managers_targeting_py39() -> None:
assert_format(source, expected, mode, minimum_version=(3, 9))


@pytest.mark.parametrize("filename", all_data_cases("preview_py_310"))
def test_preview_python_310(filename: str) -> None:
source, expected = read_data("preview_py_310", filename)
mode = black.Mode(target_versions={black.TargetVersion.PY310}, preview=True)
assert_format(source, expected, mode, minimum_version=(3, 10))


@pytest.mark.parametrize(
"filename", all_data_cases("preview_context_managers/auto_detect")
)
Expand Down

0 comments on commit 4aca4b3

Please sign in to comment.