Skip to content

Commit

Permalink
Move captured_shell_commands fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-eq committed Jan 12, 2024
1 parent 8689126 commit 8dd0c84
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
9 changes: 9 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,12 @@ def mock_release_file():
m = mock_open(read_data=read_data)
with patch("builtins.open", m):
yield m


@pytest.fixture()
def captured_shell_commands(monkeypatch):
commands = []
with monkeypatch.context() as m:
m.setattr("komodo.build.shell", lambda cmd: commands.append(cmd))
m.setattr("komodo.fetch.shell", lambda cmd: commands.append(cmd))
yield commands
8 changes: 0 additions & 8 deletions tests/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@
from komodo.package_version import LATEST_PACKAGE_ALIAS


@pytest.fixture()
def captured_shell_commands(monkeypatch):
commands = []
with monkeypatch.context() as m:
m.setattr("komodo.build.shell", lambda cmd: commands.append(cmd))
yield commands


def test_make_with_empty_pkgs(captured_shell_commands, tmpdir):
make({}, {}, {}, str(tmpdir))
assert len(captured_shell_commands) == 1
Expand Down
8 changes: 0 additions & 8 deletions tests/test_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@
from komodo.package_version import LATEST_PACKAGE_ALIAS


@pytest.fixture()
def captured_shell_commands(monkeypatch):
commands = []
with monkeypatch.context() as m:
m.setattr("komodo.fetch.shell", lambda cmd: commands.append(cmd))
yield commands


def test_make_one_pip_package(captured_shell_commands, tmpdir):
packages = {"pyaml": "20.4.0"}
repositories = {
Expand Down

0 comments on commit 8dd0c84

Please sign in to comment.