-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(clang_format_analyzer): create parent folders for target file #838
fix(clang_format_analyzer): create parent folders for target file #838
Conversation
tests/test_code_report.py
Outdated
|
||
|
||
@pytest.mark.parametrize('analyzer, extra_args, tested_content', [ | ||
['clang_format', ["--report-html"], source_code_c], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are not checking html file after running clang_format, so you don't need to add the --report-html
parameter.
BTW, the html generation is already checked in another test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, fixed
tests/test_code_report.py
Outdated
|
||
log = runner_with_analyzers.run(ConfigData().add_analyzer(analyzer, args, extra_config).finalize()) | ||
assert not re.findall(r'No such file or directory', log), f"'No such file or directory' is found in '{log}'" | ||
assert re.findall(log_fail, log), f"'{log_success}' is not found in '{log}'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assert message doesn't match the assert condition. Please fix the message or the condition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
tests/test_code_report.py
Outdated
@@ -405,3 +405,29 @@ def test_code_report_extended_arg_search_embedded(tmp_path: pathlib.Path, stdout | |||
|
|||
env.run() | |||
stdout_checker.assert_absent_calls_with_param("${CODE_REPORT_FILE}") | |||
|
|||
|
|||
@pytest.mark.parametrize('analyzer, extra_args, tested_content', [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now you don't need to parametrize the test, because you only have one set of parameter values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, removed
Description
Resolves #837
Added creation of directories before opening a file in universum/analyzers/clang_format.py:43
Checklist: