mirror of
https://github.com/kennethreitz/bake.git
synced 2026-06-05 23:00:17 +00:00
logo
This commit is contained in:
+25
-2
@@ -1,12 +1,11 @@
|
||||
import os
|
||||
|
||||
os.environ["PYTHONUNBUFFERED"] = "1"
|
||||
os.environ.pop("BAKEFILE_PATH", "")
|
||||
|
||||
import pytest
|
||||
import delegator
|
||||
|
||||
import bake.cli as bake_cli
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def bake():
|
||||
@@ -30,3 +29,27 @@ def bake():
|
||||
return c
|
||||
|
||||
return run
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def bake_i():
|
||||
def run(*args, fixture="default", assert_ok=True, block=True):
|
||||
bakefile = os.path.join(
|
||||
os.path.dirname(__file__), "fixtures", f"{fixture}.Bakefile"
|
||||
)
|
||||
cmd = " ".join(["bake", "-i", "-b", bakefile] + list(args))
|
||||
print(f"$ {cmd}")
|
||||
|
||||
c = delegator.run(cmd, block=block)
|
||||
|
||||
if block and assert_ok:
|
||||
assert c.return_code == 0
|
||||
|
||||
if block:
|
||||
|
||||
print(c.out)
|
||||
print(c.err)
|
||||
|
||||
return c
|
||||
|
||||
return run
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 8.3 KiB |
Reference in New Issue
Block a user