3222b9728d9f07cbce611ba6c57ef0d640d033a6,src/python/pants/backend/python/lint/flake8/rules_integration_test.py,,test_type_stubs,#Any#,196
Before Change
def test_type_stubs(rule_runner: RuleRunner) -> None:
Ensure that running over a type stub file doesn"t cause issues.
type_stub = FileContent("good.pyi", b"def add(x: int, y: int) -> int:\n return x + y\n")
// First check when the stub has no sibling `.py` file.
target = make_target(rule_runner, [type_stub])
assert_success(rule_runner, target)
// Then check with a sibling `.py`.
target = make_target(rule_runner, [GOOD_SOURCE, type_stub])
assert_success(rule_runner, target)
After Change
rule_runner.write_files(
{"f.pyi": BAD_FILE, "f.py": GOOD_FILE, "BUILD": "python_library(name="t")"}
)
tgts = [
rule_runner.get_target(Address("", target_name="t", relative_file_path="f.py")),
rule_runner.get_target(Address("", target_name="t", relative_file_path="f.pyi")),
]
result = run_flake8(rule_runner, tgts)
assert len(result) == 1
assert result[0].exit_code == 1
assert "f.py:" not in result[0].stdout
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
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/flake8/rules_integration_test.py
Class Name:
Method Name: test_type_stubs
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_type_stubs
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/docformatter/rules_integration_test.py
Class Name:
Method Name: test_respects_passthrough_args