mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-18 12:06:04 +00:00
#1248: Check container status before test functions
This commit is contained in:
parent
2cadcca904
commit
ef1ea4b4dd
@ -1,6 +1,20 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
from pytest_docker_pexpect.docker import run as pexpect_docker_run, \
|
||||||
|
stats as pexpect_docker_stats
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
def build_container_mock(mocker):
|
def build_container_mock(mocker):
|
||||||
return mocker.patch('pytest_docker_pexpect.docker.build_container')
|
return mocker.patch('pytest_docker_pexpect.docker.build_container')
|
||||||
|
|
||||||
|
|
||||||
|
def run_side_effect(*args, **kwargs):
|
||||||
|
container_id = pexpect_docker_run(*args, **kwargs)
|
||||||
|
pexpect_docker_stats(container_id)
|
||||||
|
return container_id
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(autouse=True)
|
||||||
|
def run_mock(mocker):
|
||||||
|
return mocker.patch('pytest_docker_pexpect.docker.run', side_effect=run_side_effect)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user