3222b9728d9f07cbce611ba6c57ef0d640d033a6,src/python/pants/backend/python/lint/black/rules_integration_test.py,,test_works_with_python38,#Any#,195
Before Change
).encode(),
)
target = make_target(rule_runner, [py38_sources], interpreter_constraints=">=3.8")
lint_results, fmt_result = run_black(rule_runner, [target])
assert len(lint_results) == 1
assert lint_results[0].exit_code == 0
assert "1 file would be left unchanged" in lint_results[0].stderr
After Change
def test_works_with_python38(rule_runner: RuleRunner) -> None:
Black"s typed-ast dependency does not understand Python 3.8, so we must instead run Black
with Python 3.8 when relevant.
content = dedent(
\
import datetime
x = True
if y := x:
print("x is truthy and now assigned to y")
class Foo:
pass
)
rule_runner.write_files(
{"f.py": content, "BUILD": "python_library(name="t", interpreter_constraints=[">=3.8"])"}
)
tgt = rule_runner.get_target(Address("", target_name="t", relative_file_path="f.py"))
lint_results, fmt_result = run_black(rule_runner, [tgt])
assert len(lint_results) == 1
assert lint_results[0].exit_code == 0
assert "1 file would be left unchanged" in lint_results[0].stderr
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 10
Instances
Project Name: pantsbuild/pants
Commit Name: 3222b9728d9f07cbce611ba6c57ef0d640d033a6
Time: 2021-04-05
Author: 14852634+Eric-Arellano@users.noreply.github.com
File Name: src/python/pants/backend/python/lint/black/rules_integration_test.py
Class Name:
Method Name: test_works_with_python38
Project Name: pantsbuild/pants
Commit Name: 3222b9728d9f07cbce611ba6c57ef0d640d033a6
Time: 2021-04-05
Author: 14852634+Eric-Arellano@users.noreply.github.com
File Name: src/python/pants/backend/python/lint/bandit/rules_integration_test.py
Class Name:
Method Name: test_uses_correct_python_version
Project Name: pantsbuild/pants
Commit Name: 3222b9728d9f07cbce611ba6c57ef0d640d033a6
Time: 2021-04-05
Author: 14852634+Eric-Arellano@users.noreply.github.com
File Name: src/python/pants/backend/python/lint/black/rules_integration_test.py
Class Name:
Method Name: test_works_with_python39
Project Name: pantsbuild/pants
Commit Name: 3222b9728d9f07cbce611ba6c57ef0d640d033a6
Time: 2021-04-05
Author: 14852634+Eric-Arellano@users.noreply.github.com
File Name: src/python/pants/backend/python/lint/black/rules_integration_test.py
Class Name:
Method Name: test_works_with_python38
Project Name: pantsbuild/pants
Commit Name: 3222b9728d9f07cbce611ba6c57ef0d640d033a6
Time: 2021-04-05
Author: 14852634+Eric-Arellano@users.noreply.github.com
File Name: src/python/pants/backend/python/lint/flake8/rules_integration_test.py
Class Name:
Method Name: test_uses_correct_python_version