Skip to content

Commit d1d7a27

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 59d9c85 commit d1d7a27

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

src/latex_dependency_scanner/scanner.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
r"(<[^<>]*>)?"
4040
r"(\[[^\[\]]*\])?"
4141
r"({(?P<relative_to>[^{}]*)})?{(?P<file>[^{}]*)}",
42-
re.M,
42+
re.MULTILINE,
4343
)
4444
"""re.Pattern: The regular expression pattern to extract included files from a LaTeX
4545
document."""

tests/test_regex.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
from __future__ import annotations
44

55
import pytest
6+
67
from latex_dependency_scanner.scanner import REGEX_TEX
78

89

9-
@pytest.mark.unit()
10+
@pytest.mark.unit
1011
@pytest.mark.parametrize(
1112
("text", "expected"),
1213
[

tests/test_scan.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
import textwrap
55

66
import pytest
7+
78
from latex_dependency_scanner.compile import compile_pdf
89
from latex_dependency_scanner.scanner import COMMON_GRAPHICS_EXTENSIONS
910
from latex_dependency_scanner.scanner import scan
10-
1111
from tests.conftest import TEST_RESOURCES
1212
from tests.conftest import needs_latexmk
1313

1414

1515
@needs_latexmk
16-
@pytest.mark.end_to_end()
16+
@pytest.mark.end_to_end
1717
def test_document_without_inclusions(tmp_path):
1818
source = r"""
1919
\documentclass{article}
@@ -31,7 +31,7 @@ def test_document_without_inclusions(tmp_path):
3131

3232

3333
@needs_latexmk
34-
@pytest.mark.end_to_end()
34+
@pytest.mark.end_to_end
3535
@pytest.mark.parametrize("directive", ["include", "input"])
3636
def test_input_or_include(tmp_path, directive):
3737
source = f"""
@@ -61,7 +61,7 @@ def test_input_or_include(tmp_path, directive):
6161
]
6262

6363

64-
@pytest.mark.end_to_end()
64+
@pytest.mark.end_to_end
6565
@pytest.mark.parametrize("directive", ["include", "input"])
6666
def test_input_or_include_without_extension_and_file(tmp_path, directive):
6767
source = f"""
@@ -83,7 +83,7 @@ def test_input_or_include_without_extension_and_file(tmp_path, directive):
8383

8484

8585
@needs_latexmk
86-
@pytest.mark.end_to_end()
86+
@pytest.mark.end_to_end
8787
@pytest.mark.parametrize("image_ext", COMMON_GRAPHICS_EXTENSIONS)
8888
@pytest.mark.parametrize("has_extension", [True, False])
8989
@pytest.mark.parametrize("file_exists", [True, False])
@@ -108,7 +108,7 @@ def test_includegraphics(tmp_path, image_ext, has_extension, file_exists):
108108
\\documentclass{{article}}
109109
\\usepackage{{graphicx}}
110110
\\begin{{document}}
111-
\\includegraphics{{image{image_ext if has_extension else ''}}}
111+
\\includegraphics{{image{image_ext if has_extension else ""}}}
112112
\\end{{document}}
113113
"""
114114
tmp_path.joinpath("document.tex").write_text(textwrap.dedent(source))
@@ -138,7 +138,7 @@ def test_includegraphics(tmp_path, image_ext, has_extension, file_exists):
138138
assert nodes == expected
139139

140140

141-
@pytest.mark.end_to_end()
141+
@pytest.mark.end_to_end
142142
def test_includegraphics_with_beamer_overlay(tmp_path):
143143
source = r"""
144144
\documentclass{beamer}
@@ -157,7 +157,7 @@ def test_includegraphics_with_beamer_overlay(tmp_path):
157157

158158

159159
@needs_latexmk
160-
@pytest.mark.end_to_end()
160+
@pytest.mark.end_to_end
161161
def test_import(tmp_path):
162162
source = """
163163
\\documentclass{article}
@@ -185,7 +185,7 @@ def test_import(tmp_path):
185185
]
186186

187187

188-
@pytest.mark.end_to_end()
188+
@pytest.mark.end_to_end
189189
def test_import_without_extension_and_file(tmp_path):
190190
source = """
191191
\\documentclass{article}
@@ -205,7 +205,7 @@ def test_import_without_extension_and_file(tmp_path):
205205

206206

207207
@needs_latexmk
208-
@pytest.mark.end_to_end()
208+
@pytest.mark.end_to_end
209209
def test_sub_import(tmp_path):
210210
source = """
211211
\\documentclass{article}
@@ -235,7 +235,7 @@ def test_sub_import(tmp_path):
235235
]
236236

237237

238-
@pytest.mark.end_to_end()
238+
@pytest.mark.end_to_end
239239
def test_sub_import_without_extension_and_file(tmp_path):
240240
source = """
241241
\\documentclass{article}
@@ -261,7 +261,7 @@ def test_sub_import_without_extension_and_file(tmp_path):
261261

262262

263263
@needs_latexmk
264-
@pytest.mark.end_to_end()
264+
@pytest.mark.end_to_end
265265
def test_mixed_import_and_subimport(tmp_path):
266266
"""Test document with mixed import and subimport directives.
267267
@@ -314,7 +314,7 @@ def test_mixed_import_and_subimport(tmp_path):
314314

315315

316316
@needs_latexmk
317-
@pytest.mark.end_to_end()
317+
@pytest.mark.end_to_end
318318
def test_natbib_bibliography(tmp_path):
319319
source = """
320320
\\documentclass{article}
@@ -335,7 +335,7 @@ def test_natbib_bibliography(tmp_path):
335335
assert nodes == [tmp_path / "document.tex", tmp_path / "bibliography.bib"]
336336

337337

338-
@pytest.mark.end_to_end()
338+
@pytest.mark.end_to_end
339339
def test_natbib_bibliography_without_extension_and_file(tmp_path):
340340
source = """
341341
\\documentclass{article}
@@ -354,7 +354,7 @@ def test_natbib_bibliography_without_extension_and_file(tmp_path):
354354

355355

356356
@needs_latexmk
357-
@pytest.mark.end_to_end()
357+
@pytest.mark.end_to_end
358358
def test_biblatex_bibliography(tmp_path):
359359
"""Test document with biblatex bibliography."""
360360
source = """
@@ -376,7 +376,7 @@ def test_biblatex_bibliography(tmp_path):
376376
assert nodes == [tmp_path / "document.tex", tmp_path / "bibliography.bib"]
377377

378378

379-
@pytest.mark.end_to_end()
379+
@pytest.mark.end_to_end
380380
def test_biblatex_bibliography_without_extension_and_file(tmp_path):
381381
"""Test document without biblatex bibliography file and extension."""
382382
source = """

0 commit comments

Comments
 (0)