3222b9728d9f07cbce611ba6c57ef0d640d033a6,src/python/pants/backend/python/lint/black/rules_integration_test.py,,test_works_with_python39,#Any#,225
Before Change
def test_works_with_python39(rule_runner: RuleRunner) -> None:
Black"s typed-ast dependency does not understand Python 3.9, so we must instead run Black
with Python 3.9 when relevant.
py39_sources = FileContent(
"py39.py",
dedent(
\
@lambda _: int
def replaced(x: bool) -> str:
return "42" if x is True else "1/137"
).encode(),
)
target = make_target(rule_runner, [py39_sources], interpreter_constraints=">=3.9")
lint_results, fmt_result = run_black(
rule_runner,
[target],
After Change
rule_runner.write_files(
{"f.py": content, "BUILD": "python_library(name="t", interpreter_constraints=[">=3.9"])"}
)
tgt = rule_runner.get_target(Address("", target_name="t", relative_file_path="f.py"))
lint_results, fmt_result = run_black(
rule_runner,
[tgt],
// TODO: remove this and go back to using the default version once the new Black release
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
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_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: 9228ad83a3ecde2fb5a714d1eb43c7c1ee2e200b
Time: 2020-04-15
Author: 14852634+Eric-Arellano@users.noreply.github.com
File Name: src/python/pants/backend/python/lint/pylint/rules_integration_test.py
Class Name: PylintIntegrationTest
Method Name: test_includes_direct_dependencies