diff --git a/tests/conftest.py b/tests/conftest.py index 18b9414..c33d866 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -8,6 +8,7 @@ import pytest from click.testing import CliRunner from pytask import storage + from pytask_stata.config import STATA_COMMANDS needs_stata = pytest.mark.skipif( @@ -78,6 +79,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 c4c87bc..e65f91c 100644 --- a/tests/test_collect.py +++ b/tests/test_collect.py @@ -4,11 +4,12 @@ import pytest from pytask import Mark + from pytask_stata.collect import _parse_stata_mark from pytask_stata.collect import stata -@pytest.mark.unit() +@pytest.mark.unit @pytest.mark.parametrize( ("args", "kwargs", "expectation", "expected"), [ @@ -32,7 +33,7 @@ def test_stata(args, kwargs, expectation, expected): assert options == expected -@pytest.mark.unit() +@pytest.mark.unit @pytest.mark.parametrize( ("mark", "expectation", "expected"), [ diff --git a/tests/test_config.py b/tests/test_config.py index 2a00be9..7fc6286 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) diff --git a/tests/test_execute.py b/tests/test_execute.py index 6aa5103..35fde81 100644 --- a/tests/test_execute.py +++ b/tests/test_execute.py @@ -12,13 +12,13 @@ from pytask import Task from pytask import build from pytask import cli + from pytask_stata.config import STATA_COMMANDS from pytask_stata.execute import pytask_execute_task_setup - from tests.conftest import needs_stata -@pytest.mark.unit() +@pytest.mark.unit @pytest.mark.parametrize( ("stata", "expectation"), [(executable, does_not_raise()) for executable in STATA_COMMANDS] @@ -42,7 +42,7 @@ def test_pytask_execute_task_setup_raise_error(stata, platform, expectation): @needs_stata -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_run_do_file(runner, tmp_path): task_source = """ import pytask @@ -72,7 +72,7 @@ def task_run_do_file(): @needs_stata -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_run_do_file_w_task_decorator(runner, tmp_path): task_source = """ import pytask @@ -102,7 +102,7 @@ def run_do_file(): assert tmp_path.joinpath("script.log").exists() -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_raise_error_if_stata_is_not_found(tmp_path, monkeypatch): task_source = """ from pytask import mark, task @@ -128,7 +128,7 @@ def task_run_do_file(): @needs_stata -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_run_do_file_w_wrong_cmd_option(runner, tmp_path): """Apparently, Stata simply discards wrong cmd options.""" task_source = """ @@ -154,7 +154,7 @@ def task_run_do_file(): @needs_stata -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_run_do_file_by_passing_path(runner, tmp_path): """Replicates example under "Command Line Arguments" in Readme.""" task_source = """ @@ -180,7 +180,7 @@ def task_run_do_file(): @needs_stata -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_run_do_file_fails_with_multiple_marks(runner, tmp_path): task_source = """ import pytask @@ -201,7 +201,7 @@ def task_run_do_file(): @needs_stata -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_with_task_without_path(runner, tmp_path): task_source = """ import pytask diff --git a/tests/test_normal_execution_w_plugin.py b/tests/test_normal_execution_w_plugin.py index d14f598..dd5a773 100644 --- a/tests/test_normal_execution_w_plugin.py +++ b/tests/test_normal_execution_w_plugin.py @@ -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")], diff --git a/tests/test_parallel.py b/tests/test_parallel.py index e511f02..e884e0d 100644 --- a/tests/test_parallel.py +++ b/tests/test_parallel.py @@ -24,7 +24,7 @@ @needs_stata -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_parallel_parametrization_over_source_files_w_loop(runner, tmp_path): source = """ import pytask @@ -56,7 +56,7 @@ def task_execute_do_file(): @needs_stata -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_parallel_parametrization_over_source_file_w_loop(runner, tmp_path): source = """ import pytask diff --git a/tests/test_parametrize.py b/tests/test_parametrize.py index f571e8d..241ee02 100644 --- a/tests/test_parametrize.py +++ b/tests/test_parametrize.py @@ -11,7 +11,7 @@ @needs_stata -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_parametrized_execution_of_do_file_w_loop(runner, tmp_path): source = """ import pytask @@ -41,7 +41,7 @@ def task_execute_do_file(): @needs_stata -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_parametrize_command_line_options_w_loop(runner, tmp_path): task_source = """ import pytask