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 Oct 7, 2024
1 parent 02287ef commit de046df
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@ def invoke(self, *args, **kwargs):
return super().invoke(*args, **kwargs)


@pytest.fixture()
@pytest.fixture
def runner():
return CustomCliRunner()
5 changes: 3 additions & 2 deletions tests/test_collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

import pytest
from pytask import Mark

from pytask_r.collect import _parse_r_mark
from pytask_r.collect import r
from pytask_r.serialization import SERIALIZERS


@pytest.mark.unit()
@pytest.mark.unit
@pytest.mark.parametrize(
("args", "kwargs", "expectation", "expected"),
[
Expand Down Expand Up @@ -43,7 +44,7 @@ def test_r(args, kwargs, expectation, expected):
assert result == expected


@pytest.mark.unit()
@pytest.mark.unit
@pytest.mark.parametrize(
(
"mark",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "r" in session.config["markers"]
22 changes: 11 additions & 11 deletions tests/test_execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
from pytask import Task
from pytask import build
from pytask import cli
from pytask_r.execute import pytask_execute_task_setup

from pytask_r.execute import pytask_execute_task_setup
from tests.conftest import needs_rscript
from tests.conftest import parametrize_parse_code_serializer_suffix


@pytest.mark.unit()
@pytest.mark.unit
def test_pytask_execute_task_setup(monkeypatch):
"""Make sure that the task setup raises errors."""
# Act like r is installed since we do not test this.
Expand All @@ -33,7 +33,7 @@ def test_pytask_execute_task_setup(monkeypatch):


@needs_rscript
@pytest.mark.end_to_end()
@pytest.mark.end_to_end
@parametrize_parse_code_serializer_suffix
@pytest.mark.parametrize("depends_on", ["'in_1.txt'", "['in_1.txt', 'in_2.txt']"])
def test_run_r_script( # noqa: PLR0913
Expand Down Expand Up @@ -70,7 +70,7 @@ def task_run_r_script(produces = Path("out.txt")): ...


@needs_rscript
@pytest.mark.end_to_end()
@pytest.mark.end_to_end
@parametrize_parse_code_serializer_suffix
def test_run_r_script_w_task_decorator(
runner, tmp_path, parse_config_code, serializer, suffix
Expand Down Expand Up @@ -100,7 +100,7 @@ def run_r_script(): ...


@needs_rscript
@pytest.mark.end_to_end()
@pytest.mark.end_to_end
@parametrize_parse_code_serializer_suffix
def test_raise_error_if_rscript_is_not_found(
tmp_path, monkeypatch, parse_config_code, serializer, suffix
Expand Down Expand Up @@ -132,7 +132,7 @@ def task_run_r_script(): ...


@needs_rscript
@pytest.mark.end_to_end()
@pytest.mark.end_to_end
@parametrize_parse_code_serializer_suffix
def test_run_r_script_w_saving_workspace(
runner, tmp_path, parse_config_code, serializer, suffix
Expand Down Expand Up @@ -167,7 +167,7 @@ def task_run_r_script(): ...


@needs_rscript
@pytest.mark.end_to_end()
@pytest.mark.end_to_end
@parametrize_parse_code_serializer_suffix
def test_run_r_script_w_wrong_cmd_option(
runner, tmp_path, parse_config_code, serializer, suffix
Expand Down Expand Up @@ -202,7 +202,7 @@ def task_run_r_script(): ...


@needs_rscript
@pytest.mark.end_to_end()
@pytest.mark.end_to_end
def test_run_r_script_w_custom_serializer(runner, tmp_path):
task_source = """
import pytask
Expand Down Expand Up @@ -232,7 +232,7 @@ def task_run_r_script(): ...


@needs_rscript
@pytest.mark.end_to_end()
@pytest.mark.end_to_end
def test_run_r_script_fails_w_multiple_markers(runner, tmp_path):
task_source = """
import pytask
Expand All @@ -252,7 +252,7 @@ def task_run_r_script(): ...


@needs_rscript
@pytest.mark.end_to_end()
@pytest.mark.end_to_end
def test_run_r_script_with_capital_extension(runner, tmp_path):
task_source = """
import pytask
Expand Down Expand Up @@ -280,7 +280,7 @@ def task_run_r_script(): ...


@needs_rscript
@pytest.mark.end_to_end()
@pytest.mark.end_to_end
@parametrize_parse_code_serializer_suffix
def test_run_r_script_w_nested_inputs(
runner, tmp_path, parse_config_code, serializer, suffix
Expand Down
2 changes: 1 addition & 1 deletion tests/test_normal_execution_w_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pytask import cli


@pytest.mark.end_to_end()
@pytest.mark.end_to_end
@pytest.mark.parametrize(
"dependencies",
[(), ("in.txt",), ("in_1.txt", "in_2.txt")],
Expand Down
6 changes: 3 additions & 3 deletions tests/test_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


@needs_rscript
@pytest.mark.end_to_end()
@pytest.mark.end_to_end
@parametrize_parse_code_serializer_suffix
def test_parallel_parametrization_over_source_files_w_loop(
runner, tmp_path, parse_config_code, serializer, suffix
Expand Down Expand Up @@ -69,7 +69,7 @@ def task_execute_r_script():


@needs_rscript
@pytest.mark.end_to_end()
@pytest.mark.end_to_end
@parametrize_parse_code_serializer_suffix
def test_parallel_parametrization_over_source_file_w_loop(
runner, tmp_path, parse_config_code, serializer, suffix
Expand Down Expand Up @@ -106,7 +106,7 @@ def execute_r_script():


@needs_rscript
@pytest.mark.end_to_end()
@pytest.mark.end_to_end
@parametrize_parse_code_serializer_suffix
@pytest.mark.xfail(reason="@task does not support partialed functions.")
def test_parallel_parametrization_over_source_file_w_loop_and_lambda(
Expand Down
4 changes: 2 additions & 2 deletions tests/test_parametrize.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


@needs_rscript
@pytest.mark.end_to_end()
@pytest.mark.end_to_end
@parametrize_parse_code_serializer_suffix
def test_parametrized_execution_of_r_script_w_loop(
runner, tmp_path, parse_config_code, serializer, suffix
Expand Down Expand Up @@ -53,7 +53,7 @@ def task_run_r_script():


@needs_rscript
@pytest.mark.end_to_end()
@pytest.mark.end_to_end
@parametrize_parse_code_serializer_suffix
def test_parametrize_r_options_and_product_paths_w_loop(
runner, tmp_path, parse_config_code, serializer, suffix
Expand Down

0 comments on commit de046df

Please sign in to comment.