mirror of
https://github.com/frappe/frappe_docker.git
synced 2026-06-27 17:25:08 +00:00
Cover all cases
This commit is contained in:
parent
c6717a1720
commit
31518803ad
2 changed files with 7 additions and 7 deletions
|
|
@ -43,16 +43,12 @@ def compose(env_file: str):
|
||||||
|
|
||||||
@pytest.fixture(autouse=True, scope="session")
|
@pytest.fixture(autouse=True, scope="session")
|
||||||
def frappe_setup(compose: Compose):
|
def frappe_setup(compose: Compose):
|
||||||
# Stop all containers in `test` project if they are running.
|
compose.stop()
|
||||||
# We don't care if it fails.
|
|
||||||
with suppress(subprocess.CalledProcessError):
|
|
||||||
compose.stop()
|
|
||||||
|
|
||||||
compose("up", "-d", "--quiet-pull")
|
compose("up", "-d", "--quiet-pull")
|
||||||
yield
|
yield
|
||||||
|
|
||||||
with suppress(subprocess.CalledProcessError):
|
compose.stop()
|
||||||
compose.stop()
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
from contextlib import suppress
|
||||||
import os
|
import os
|
||||||
import ssl
|
import ssl
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
@ -46,7 +47,10 @@ class Compose:
|
||||||
self("exec", "-T", *cmd)
|
self("exec", "-T", *cmd)
|
||||||
|
|
||||||
def stop(self) -> None:
|
def stop(self) -> None:
|
||||||
subprocess.check_call(self.base_cmd + ("down", "-v", "--remove-orphans"))
|
# Stop all containers in `test` project if they are running.
|
||||||
|
# We don't care if it fails.
|
||||||
|
with suppress(subprocess.CalledProcessError):
|
||||||
|
subprocess.check_call(self.base_cmd + ("down", "-v", "--remove-orphans"))
|
||||||
|
|
||||||
def bench(self, *cmd: str) -> None:
|
def bench(self, *cmd: str) -> None:
|
||||||
self.exec("backend", "bench", *cmd)
|
self.exec("backend", "bench", *cmd)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue