Skip to content

Commit

Permalink
Add coverage comments and minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
mondeja committed May 2, 2024
1 parent e3fc5ed commit 1e75af9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/mkdocs_include_markdown_plugin/directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def resolve_file_paths_to_include(
), False

if process.is_relative_path(include_string):
if includer_page_src_path is None:
if includer_page_src_path is None: # pragma: no cover
raise PluginError(
'Relative paths are not allowed when the includer page'
' source path is not provided. The include string'
Expand Down Expand Up @@ -248,7 +248,7 @@ def resolve_file_paths_to_exclude(
return glob.glob(exclude_string, flags=GLOB_FLAGS)

if process.is_relative_path(exclude_string):
if includer_page_src_path is None:
if includer_page_src_path is None: # pragma: no cover
raise PluginError(
'Relative paths are not allowed when the includer page'
' source path is not provided. The exclude string'
Expand Down
4 changes: 2 additions & 2 deletions src/mkdocs_include_markdown_plugin/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def file_lineno_message(
lineno: int,
) -> str:
"""Return a message with the file path and line number."""
if page_src_path is None:
if page_src_path is None: # pragma: no cover
return f'generated page content (line {lineno})'
return (
f'{os.path.relpath(page_src_path, docs_dir)}'
Expand Down Expand Up @@ -541,7 +541,7 @@ def found_include_markdown_tag( # noqa: PLR0912, PLR0915

# relative URLs rewriting
if bool_options['rewrite-relative-urls'].value:
if page_src_path is None:
if page_src_path is None: # pragma: no cover
logger.warning(
'Relative URLs rewriting is not supported in'
' generated pages.',
Expand Down

0 comments on commit 1e75af9

Please sign in to comment.