3222b9728d9f07cbce611ba6c57ef0d640d033a6,src/python/pants/backend/python/lint/bandit/rules_integration_test.py,,test_type_stubs,#Any#,208

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")
    // 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.get_target(Address("", target_name="t", relative_file_path="f.pyi")),
    ]
    result = run_bandit(rule_runner, tgts)
    assert len(result) == 1
    assert result[0].exit_code == 1
    assert "f.py " not in result[0].stdout
    assert "f.pyi" in result[0].stdout
    assert "Issue: [B303:blacklist] Use of insecure MD2, MD4, MD5" in result[0].stdout
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

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/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/flake8/rules_integration_test.py
Class Name:
Method Name: test_type_stubs


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