Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 2, 2024
1 parent af2fe06 commit 3b6e780
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/latex_dependency_scanner/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
r"(<[^<>]*>)?"
r"(\[[^\[\]]*\])?"
r"({(?P<relative_to>[^{}]*)})?{(?P<file>[^{}]*)}",
re.M,
re.MULTILINE,
)
"""re.Pattern: The regular expression pattern to extract included files from a LaTeX
document."""
Expand Down
3 changes: 2 additions & 1 deletion tests/test_regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
from __future__ import annotations

import pytest

from latex_dependency_scanner.scanner import REGEX_TEX


@pytest.mark.unit()
@pytest.mark.unit
@pytest.mark.parametrize(
("text", "expected"),
[
Expand Down
30 changes: 15 additions & 15 deletions tests/test_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
import textwrap

import pytest

from latex_dependency_scanner.compile import compile_pdf
from latex_dependency_scanner.scanner import COMMON_GRAPHICS_EXTENSIONS
from latex_dependency_scanner.scanner import scan

from tests.conftest import TEST_RESOURCES
from tests.conftest import needs_latexmk


@needs_latexmk
@pytest.mark.end_to_end()
@pytest.mark.end_to_end
def test_document_without_inclusions(tmp_path):
source = r"""
\documentclass{article}
Expand All @@ -31,7 +31,7 @@ def test_document_without_inclusions(tmp_path):


@needs_latexmk
@pytest.mark.end_to_end()
@pytest.mark.end_to_end
@pytest.mark.parametrize("directive", ["include", "input"])
def test_input_or_include(tmp_path, directive):
source = f"""
Expand Down Expand Up @@ -61,7 +61,7 @@ def test_input_or_include(tmp_path, directive):
]


@pytest.mark.end_to_end()
@pytest.mark.end_to_end
@pytest.mark.parametrize("directive", ["include", "input"])
def test_input_or_include_without_extension_and_file(tmp_path, directive):
source = f"""
Expand All @@ -83,7 +83,7 @@ def test_input_or_include_without_extension_and_file(tmp_path, directive):


@needs_latexmk
@pytest.mark.end_to_end()
@pytest.mark.end_to_end
@pytest.mark.parametrize("image_ext", COMMON_GRAPHICS_EXTENSIONS)
@pytest.mark.parametrize("has_extension", [True, False])
@pytest.mark.parametrize("file_exists", [True, False])
Expand Down Expand Up @@ -138,7 +138,7 @@ def test_includegraphics(tmp_path, image_ext, has_extension, file_exists):
assert nodes == expected


@pytest.mark.end_to_end()
@pytest.mark.end_to_end
def test_includegraphics_with_beamer_overlay(tmp_path):
source = r"""
\documentclass{beamer}
Expand All @@ -157,7 +157,7 @@ def test_includegraphics_with_beamer_overlay(tmp_path):


@needs_latexmk
@pytest.mark.end_to_end()
@pytest.mark.end_to_end
def test_import(tmp_path):
source = """
\\documentclass{article}
Expand Down Expand Up @@ -185,7 +185,7 @@ def test_import(tmp_path):
]


@pytest.mark.end_to_end()
@pytest.mark.end_to_end
def test_import_without_extension_and_file(tmp_path):
source = """
\\documentclass{article}
Expand All @@ -205,7 +205,7 @@ def test_import_without_extension_and_file(tmp_path):


@needs_latexmk
@pytest.mark.end_to_end()
@pytest.mark.end_to_end
def test_sub_import(tmp_path):
source = """
\\documentclass{article}
Expand Down Expand Up @@ -235,7 +235,7 @@ def test_sub_import(tmp_path):
]


@pytest.mark.end_to_end()
@pytest.mark.end_to_end
def test_sub_import_without_extension_and_file(tmp_path):
source = """
\\documentclass{article}
Expand All @@ -261,7 +261,7 @@ def test_sub_import_without_extension_and_file(tmp_path):


@needs_latexmk
@pytest.mark.end_to_end()
@pytest.mark.end_to_end
def test_mixed_import_and_subimport(tmp_path):
"""Test document with mixed import and subimport directives.
Expand Down Expand Up @@ -314,7 +314,7 @@ def test_mixed_import_and_subimport(tmp_path):


@needs_latexmk
@pytest.mark.end_to_end()
@pytest.mark.end_to_end
def test_natbib_bibliography(tmp_path):
source = """
\\documentclass{article}
Expand All @@ -335,7 +335,7 @@ def test_natbib_bibliography(tmp_path):
assert nodes == [tmp_path / "document.tex", tmp_path / "bibliography.bib"]


@pytest.mark.end_to_end()
@pytest.mark.end_to_end
def test_natbib_bibliography_without_extension_and_file(tmp_path):
source = """
\\documentclass{article}
Expand All @@ -354,7 +354,7 @@ def test_natbib_bibliography_without_extension_and_file(tmp_path):


@needs_latexmk
@pytest.mark.end_to_end()
@pytest.mark.end_to_end
def test_biblatex_bibliography(tmp_path):
"""Test document with biblatex bibliography."""
source = """
Expand All @@ -376,7 +376,7 @@ def test_biblatex_bibliography(tmp_path):
assert nodes == [tmp_path / "document.tex", tmp_path / "bibliography.bib"]


@pytest.mark.end_to_end()
@pytest.mark.end_to_end
def test_biblatex_bibliography_without_extension_and_file(tmp_path):
"""Test document without biblatex bibliography file and extension."""
source = """
Expand Down

0 comments on commit 3b6e780

Please sign in to comment.