Skip to content

Commit

Permalink
🔬 Move test helpers to a separate module
Browse files Browse the repository at this point in the history
  • Loading branch information
spapanik committed Dec 15, 2024
1 parent 54be844 commit 5bf8643
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 27 deletions.
17 changes: 0 additions & 17 deletions tests/conftest.py → tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
from typing import Any
from unittest import mock

import pytest

from yamk.command.make import MakeCommand

TEST_DATA_ROOT = pathlib.Path(__file__).resolve().parent.joinpath("data")
Expand Down Expand Up @@ -41,18 +39,3 @@ def get_make_command(**kwargs: Any) -> MakeCommand:
setattr(mock_args, key, value)

return MakeCommand(mock_args)


@pytest.fixture
def mock_args() -> mock.MagicMock:
args = mock.MagicMock()
args.directory = "."
args.cookbook = TEST_COOKBOOK
args.cookbook_type = None
args.verbosity = 0
args.bare = False
args.time = False
args.force = False
args.dry_run = False
args.extra = []
return args
2 changes: 1 addition & 1 deletion tests/yamk/command/test_make/test_arguments.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from unittest import mock

from tests.conftest import get_make_command, runner_exit_success
from tests.helpers import get_make_command, runner_exit_success

COOKBOOK = "arguments.yaml"

Expand Down
2 changes: 1 addition & 1 deletion tests/yamk/command/test_make/test_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from tests.conftest import get_make_command, runner_exit_success
from tests.helpers import get_make_command, runner_exit_success

COOKBOOK = "dag.yaml"

Expand Down
2 changes: 1 addition & 1 deletion tests/yamk/command/test_make/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from tests.conftest import get_make_command, runner_exit_failure, runner_exit_success
from tests.helpers import get_make_command, runner_exit_failure, runner_exit_success

COOKBOOK = "exceptions.yaml"

Expand Down
2 changes: 1 addition & 1 deletion tests/yamk/command/test_make/test_functions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from unittest import mock

from tests.conftest import get_make_command, runner_exit_success
from tests.helpers import get_make_command, runner_exit_success

COOKBOOK = "functions.yaml"

Expand Down
2 changes: 1 addition & 1 deletion tests/yamk/command/test_make/test_make.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from unittest import mock

from tests.conftest import get_make_command, runner_exit_success
from tests.helpers import get_make_command, runner_exit_success

COOKBOOK = "make.yaml"

Expand Down
2 changes: 1 addition & 1 deletion tests/yamk/command/test_make/test_overrides.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from unittest import mock

from tests.conftest import get_make_command, runner_exit_success
from tests.helpers import get_make_command, runner_exit_success

COOKBOOK = "overrides.yaml"

Expand Down
2 changes: 1 addition & 1 deletion tests/yamk/command/test_make/test_regex.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from unittest import mock

from tests.conftest import get_make_command, runner_exit_success
from tests.helpers import get_make_command, runner_exit_success

COOKBOOK = "regex.yaml"

Expand Down
2 changes: 1 addition & 1 deletion tests/yamk/command/test_make/test_requirements.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from unittest import mock

from tests.conftest import get_make_command, runner_exit_success
from tests.helpers import get_make_command, runner_exit_success

COOKBOOK = "requirements.yaml"

Expand Down
2 changes: 1 addition & 1 deletion tests/yamk/command/test_make/test_should_build.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from unittest import mock

from tests.conftest import get_make_command, runner_exit_success
from tests.helpers import get_make_command, runner_exit_success

COOKBOOK = "should_build.yaml"

Expand Down
2 changes: 1 addition & 1 deletion tests/yamk/command/test_make/test_variables.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from unittest import mock

from tests.conftest import get_make_command, runner_exit_success
from tests.helpers import get_make_command, runner_exit_success

COOKBOOK = "variables.yaml"

Expand Down

0 comments on commit 5bf8643

Please sign in to comment.