From 3b6e78024d21c28d09dd2ef365b40c8003c16f4a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 19:53:28 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/latex_dependency_scanner/scanner.py | 2 +- tests/test_regex.py | 3 ++- tests/test_scan.py | 30 ++++++++++++------------- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/latex_dependency_scanner/scanner.py b/src/latex_dependency_scanner/scanner.py index fe6aa29..2ea75e2 100644 --- a/src/latex_dependency_scanner/scanner.py +++ b/src/latex_dependency_scanner/scanner.py @@ -39,7 +39,7 @@ r"(<[^<>]*>)?" r"(\[[^\[\]]*\])?" r"({(?P[^{}]*)})?{(?P[^{}]*)}", - re.M, + re.MULTILINE, ) """re.Pattern: The regular expression pattern to extract included files from a LaTeX document.""" diff --git a/tests/test_regex.py b/tests/test_regex.py index c037747..14bf3d5 100644 --- a/tests/test_regex.py +++ b/tests/test_regex.py @@ -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"), [ diff --git a/tests/test_scan.py b/tests/test_scan.py index ecff6d7..6427dea 100644 --- a/tests/test_scan.py +++ b/tests/test_scan.py @@ -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} @@ -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""" @@ -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""" @@ -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]) @@ -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} @@ -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} @@ -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} @@ -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} @@ -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} @@ -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. @@ -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} @@ -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} @@ -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 = """ @@ -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 = """