Example #1
0
def test_file_with_issues(file_name: str, n_issues: int):
    inspector = PythonAstInspector()
    path_to_file = PYTHON_DATA_FOLDER / file_name
    with use_file_metadata(path_to_file) as file_metadata:
        issues = inspector.inspect(file_metadata.path, {})

    assert len(issues) == n_issues
def test_file_with_issues(file_name: str, n_issues: int):
    inspector = ESLintInspector()

    path_to_file = JS_DATA_FOLDER / file_name
    with use_file_metadata(path_to_file) as file_metadata:
        issues = inspector.inspect(file_metadata.path, {})
        issues = filter_low_measure_issues(issues, Language.JS)

    assert len(issues) == n_issues
Example #3
0
def test_file_with_issues_info(file_name: str,
                               expected_issues_info: IssuesTestInfo):
    inspector = Flake8Inspector()

    path_to_file = PYTHON_DATA_FOLDER / file_name
    with use_file_metadata(path_to_file) as file_metadata:
        issues = inspector.inspect(file_metadata.path, {})

    issues_info = gather_issues_test_info(issues)
    assert issues_info == expected_issues_info
Example #4
0
def test_file_with_issues(file_name: str, n_issues: int):
    inspector = Flake8Inspector()

    path_to_file = PYTHON_DATA_FOLDER / file_name
    with use_file_metadata(path_to_file) as file_metadata:
        issues = inspector.inspect(file_metadata.path, {})
        issues = list(
            filter(lambda i: i.type != IssueType.INFO,
                   filter_low_measure_issues(issues, Language.PYTHON)))

        assert len(issues) == n_issues