3f431b9aba35ce9f2df33cf9fc0dd786c2fe3f91,src/python/pants/core/goals/lint_test.py,,run_lint_rule,#,120

Before Change


    per_file_caching: bool,
    include_sources: bool = True,
) -> Tuple[int, str]:
    console = MockConsole(use_colors=False)
    workspace = Workspace(rule_runner.scheduler)
    union_membership = UnionMembership({LintRequest: lint_request_types})
    result: Lint = run_rule_with_mocks(
        lint,
        rule_args=[
            console,
            workspace,
            Targets(targets),
            create_goal_subsystem(
                LintSubsystem, per_file_caching=per_file_caching, per_target_caching=False
            ),
            union_membership,
        ],
        mock_gets=[
            MockGet(
                output_type=EnrichedLintResults,
                input_type=LintRequest,
                mock=lambda field_set_collection: field_set_collection.lint_results,
            ),
            MockGet(
                output_type=FieldSetsWithSources,
                input_type=FieldSetsWithSourcesRequest,
                mock=lambda field_sets: FieldSetsWithSources(field_sets if include_sources else ()),
            ),
            MockGet(output_type=Digest, input_type=MergeDigests, mock=lambda _: EMPTY_DIGEST),
        ],
        union_membership=union_membership,
    )
    assert not console.stdout.getvalue()
    return result.exit_code, console.stderr.getvalue()


def test_empty_target_noops(rule_runner: RuleRunner) -> None:
    def assert_noops(per_file_caching: bool) -> None:

After Change


    per_file_caching: bool,
    include_sources: bool = True,
) -> Tuple[int, str]:
    with mock_console(rule_runner.options_bootstrapper) as (console, stdio_reader):
        workspace = Workspace(rule_runner.scheduler)
        union_membership = UnionMembership({LintRequest: lint_request_types})
        result: Lint = run_rule_with_mocks(
            lint,
            rule_args=[
                console,
                workspace,
                Targets(targets),
                create_goal_subsystem(
                    LintSubsystem, per_file_caching=per_file_caching, per_target_caching=False
                ),
                union_membership,
            ],
            mock_gets=[
                MockGet(
                    output_type=EnrichedLintResults,
                    input_type=LintRequest,
                    mock=lambda field_set_collection: field_set_collection.lint_results,
                ),
                MockGet(
                    output_type=FieldSetsWithSources,
                    input_type=FieldSetsWithSourcesRequest,
                    mock=lambda field_sets: FieldSetsWithSources(
                        field_sets if include_sources else ()
                    ),
                ),
                MockGet(output_type=Digest, input_type=MergeDigests, mock=lambda _: EMPTY_DIGEST),
            ],
            union_membership=union_membership,
        )
        assert not stdio_reader.get_stdout()
        return result.exit_code, stdio_reader.get_stderr()


def test_empty_target_noops(rule_runner: RuleRunner) -> None:
    def assert_noops(per_file_caching: bool) -> None:
        exit_code, stderr = run_lint_rule(
            rule_runner,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 12

Instances


Project Name: pantsbuild/pants
Commit Name: 3f431b9aba35ce9f2df33cf9fc0dd786c2fe3f91
Time: 2021-04-02
Author: dawagner@gmail.com
File Name: src/python/pants/core/goals/lint_test.py
Class Name:
Method Name: run_lint_rule


Project Name: pantsbuild/pants
Commit Name: 15f70ee5e5a6d9ab272bed0ea66f541c6c91b091
Time: 2021-04-09
Author: 14852634+Eric-Arellano@users.noreply.github.com
File Name: src/python/pants/core/goals/typecheck_test.py
Class Name:
Method Name: run_typecheck_rule


Project Name: pantsbuild/pants
Commit Name: 87f22614a3a97d93aaf570ba1c3eeefcbfdb8d5f
Time: 2021-03-01
Author: stuhood@gmail.com
File Name: src/python/pants/core/goals/test_test.py
Class Name:
Method Name: run_test_rule