From be94bee130496abd95b804e59957fe16a3a662ce Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 19:35:36 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/conftest.py | 2 +- tests/test_collect.py | 3 +- tests/test_config.py | 2 +- tests/test_execute.py | 40 +++++++++++++------------- tests/test_latex_dependency_scanner.py | 2 +- tests/test_parallel.py | 4 +-- tests/test_parametrize.py | 4 +-- 7 files changed, 29 insertions(+), 28 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 195e3c0..c7c1474 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -85,6 +85,6 @@ def invoke(self, *args, **kwargs): return super().invoke(*args, **kwargs) -@pytest.fixture() +@pytest.fixture def runner(): return CustomCliRunner() diff --git a/tests/test_collect.py b/tests/test_collect.py index 536f2ba..58fca5d 100644 --- a/tests/test_collect.py +++ b/tests/test_collect.py @@ -3,10 +3,11 @@ from contextlib import ExitStack as does_not_raise # noqa: N813 import pytest + from pytask_latex.collect import latex -@pytest.mark.unit() +@pytest.mark.unit @pytest.mark.parametrize( ("kwargs", "expectation", "expected"), [ diff --git a/tests/test_config.py b/tests/test_config.py index 423359c..f500c04 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -4,7 +4,7 @@ from pytask import build -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_marker_is_configured(tmp_path): session = build(paths=tmp_path) assert "latex" in session.config["markers"] diff --git a/tests/test_execute.py b/tests/test_execute.py index 8244cef..fe7a16e 100644 --- a/tests/test_execute.py +++ b/tests/test_execute.py @@ -9,14 +9,14 @@ from pytask import Task from pytask import build from pytask import cli -from pytask_latex.execute import pytask_execute_task_setup +from pytask_latex.execute import pytask_execute_task_setup from tests.conftest import TEST_RESOURCES from tests.conftest import needs_latexmk from tests.conftest import skip_on_github_actions_with_win -@pytest.mark.unit() +@pytest.mark.unit def test_pytask_execute_task_setup(monkeypatch): """Make sure that the task setup raises errors.""" # Act like latexmk is installed since we do not test this. @@ -33,7 +33,7 @@ def test_pytask_execute_task_setup(monkeypatch): @needs_latexmk @skip_on_github_actions_with_win -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_compile_latex_document(runner, tmp_path): """Test simple compilation.""" task_source = """ @@ -59,7 +59,7 @@ def task_compile_document(): @needs_latexmk @skip_on_github_actions_with_win -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_compile_latex_document_w_relative(runner, tmp_path): """Test simple compilation.""" task_source = f""" @@ -91,7 +91,7 @@ def task_compile_document(): @needs_latexmk @skip_on_github_actions_with_win -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_compile_latex_document_to_different_name(runner, tmp_path): """Compile a LaTeX document where source and output name differ.""" task_source = """ @@ -118,7 +118,7 @@ def task_compile_document(): @needs_latexmk @skip_on_github_actions_with_win -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_compile_w_bibliography(runner, tmp_path): """Compile a LaTeX document with bibliography.""" task_source = """ @@ -158,7 +158,7 @@ def task_compile_document(): @needs_latexmk @skip_on_github_actions_with_win -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_raise_error_if_latexmk_is_not_found(tmp_path, monkeypatch): task_source = """ from pytask import mark @@ -192,7 +192,7 @@ def task_compile_document(): @needs_latexmk @skip_on_github_actions_with_win -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_compile_latex_document_w_xelatex(runner, tmp_path): task_source = """ from pytask import mark @@ -227,7 +227,7 @@ def task_compile_document(): @needs_latexmk @skip_on_github_actions_with_win -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_compile_latex_document_w_two_dependencies(runner, tmp_path): task_source = """ from pytask import mark @@ -255,7 +255,7 @@ def task_compile_document(path: Path = Path("in.txt")): @needs_latexmk @skip_on_github_actions_with_win -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_fail_because_script_is_not_latex(tmp_path): task_source = """ from pytask import mark @@ -283,7 +283,7 @@ def task_compile_document(path: Path = Path("in.txt")): @needs_latexmk @skip_on_github_actions_with_win -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_compile_document_to_out_if_document_has_relative_resources(tmp_path): """Test that motivates the ``"--cd"`` flag. @@ -326,7 +326,7 @@ def task_compile_document(path: Path = Path("resources/content.tex")): @needs_latexmk @skip_on_github_actions_with_win -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_compile_document_w_wrong_flag(tmp_path): """Test that wrong flags raise errors.""" tmp_path.joinpath("sub").mkdir(parents=True) @@ -361,7 +361,7 @@ def task_compile_document(): @needs_latexmk -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_compile_document_w_image(runner, tmp_path): task_source = f""" from pytask import Product @@ -397,7 +397,7 @@ def task_compile_document(): @needs_latexmk @skip_on_github_actions_with_win -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_compile_latex_document_w_multiple_marks(runner, tmp_path): """Test simple compilation.""" task_source = """ @@ -425,7 +425,7 @@ def task_compile_document(): @needs_latexmk @skip_on_github_actions_with_win -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_compile_latex_document_with_wrong_extension(runner, tmp_path): """Test simple compilation.""" task_source = """ @@ -452,7 +452,7 @@ def task_compile_document(): @needs_latexmk @skip_on_github_actions_with_win -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_compile_w_bibliography_and_keep_bbl(runner, tmp_path): """Compile a LaTeX document with bibliography.""" task_source = """ @@ -496,7 +496,7 @@ def task_compile_document( @needs_latexmk @skip_on_github_actions_with_win -@pytest.mark.end_to_end() +@pytest.mark.end_to_end @pytest.mark.parametrize( ("step", "message"), [ @@ -536,7 +536,7 @@ def task_compile_document(): @needs_latexmk @skip_on_github_actions_with_win -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_compile_latex_document_with_task_decorator(runner, tmp_path): """Test simple compilation.""" task_source = """ @@ -563,7 +563,7 @@ def compile_document(): @needs_latexmk @skip_on_github_actions_with_win -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_use_task_without_path(tmp_path): task_source = """ import pytask @@ -591,7 +591,7 @@ def test_use_task_without_path(tmp_path): @needs_latexmk @skip_on_github_actions_with_win -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_collect_latex_document_with_product_from_another_task(runner, tmp_path): """Test simple compilation.""" task_source = """ diff --git a/tests/test_latex_dependency_scanner.py b/tests/test_latex_dependency_scanner.py index 84dd217..493aa89 100644 --- a/tests/test_latex_dependency_scanner.py +++ b/tests/test_latex_dependency_scanner.py @@ -12,7 +12,7 @@ @needs_latexmk @skip_on_github_actions_with_win -@pytest.mark.end_to_end() +@pytest.mark.end_to_end @pytest.mark.parametrize("infer_dependencies", ["true", "false"]) def test_infer_dependencies_from_task(tmp_path, infer_dependencies): task_source = """ diff --git a/tests/test_parallel.py b/tests/test_parallel.py index c37735f..ec94c6b 100644 --- a/tests/test_parallel.py +++ b/tests/test_parallel.py @@ -32,7 +32,7 @@ @xfail_on_remote @needs_latexmk @skip_on_github_actions_with_win -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_parallel_parametrization_over_source_files_w_loop(runner, tmp_path): source = """ from pytask import mark, task @@ -68,7 +68,7 @@ def task_compile_latex_document(): @xfail_on_remote @needs_latexmk @skip_on_github_actions_with_win -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_parallel_parametrization_over_source_file_w_loop(runner, tmp_path): source = """ from pytask import mark, task diff --git a/tests/test_parametrize.py b/tests/test_parametrize.py index 09a611b..4965c1c 100644 --- a/tests/test_parametrize.py +++ b/tests/test_parametrize.py @@ -12,7 +12,7 @@ @needs_latexmk @skip_on_github_actions_with_win -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_parametrized_compilation_of_latex_documents_w_loop(tmp_path): source = """ from pytask import mark, task @@ -48,7 +48,7 @@ def task_compile_latex_document(): @needs_latexmk @skip_on_github_actions_with_win -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_parametrizing_latex_options_w_loop(tmp_path): source = """ from pytask import mark, task