diff --git a/test/test_parser.py b/test/test_parser.py index da630ea8..f99a5e26 100755 --- a/test/test_parser.py +++ b/test/test_parser.py @@ -81,7 +81,8 @@ def get_output(self): roots[key] = root for error in errors: - errors_str += f'{error.level.name}: {os.path.basename(error.filename)}:{error.line}: {error.message}\n' # noqa: E501 + filename = os.path.basename(error.filename) if error.filename else '' + errors_str += f'{error.level.name}: {filename}:{error.line}: {error.message}\n' # noqa: E501 for directive in self.directives: filename = directive.get_input_filename()