-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
41 lines (29 loc) · 826 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from invoke import task
edge = "EDGEDB_INSTANCE=wat_test"
pr = "poetry run"
def pytest_params(lf, debug):
lf = "--lf" if lf else ""
debug = "--log-level=DEBUG -vv" if debug else ""
return f"{lf} {debug}"
@task
def unit(c, lf=False, debug=False):
c.run(
f"{pr} pytest --code-highlight=yes {pytest_params(lf, debug)} tests/unit",
pty=True,
)
@task
def test_db(c):
c.run(
"""
edgedb instance destroy --force --non-interactive -I wat_test || true
edgedb instance create --non-interactive wat_test
edgedb migrate -I wat_test
""",
pty=True,
)
@task(test_db)
def func(c, lf=False, debug=False):
c.run(f"{edge} {pr} pytest {pytest_params(lf, debug)} tests/functional", pty=True)
@task(test_db)
def view(c, lf=False):
pass