Check makefile is ok and run test
This commit is contained in:
parent
a32ec91610
commit
18464e0b86
|
@ -0,0 +1 @@
|
|||
.venv*
|
|
@ -0,0 +1,45 @@
|
|||
|
||||
|
||||
system_minor := $(shell python3 -c "import sys;print(sys.version_info.minor)")
|
||||
minor?=$(system_minor)
|
||||
|
||||
PYTHON=python3.$(minor)
|
||||
venv=.venv3.$(minor)
|
||||
python=$(venv)/bin/python
|
||||
pytest=$(python) -m pytest
|
||||
|
||||
py_install=$(python) -m pip
|
||||
|
||||
|
||||
.venv3.$(minor):
|
||||
$(PYTHON) -m venv $(venv)
|
||||
|
||||
|
||||
|
||||
test: venv
|
||||
$(pytest) --version || make install
|
||||
|
||||
$(pytest) -sv --durations=5 --ignore-glob=sample_* .
|
||||
|
||||
qtest: venv
|
||||
$(pytest) --lf --ff -v --durations=5 .
|
||||
|
||||
|
||||
install_dependencies:
|
||||
$(py_install) install -U pip wheel
|
||||
$(py_install) install pytest python-dotenv pytest-icdiff
|
||||
|
||||
|
||||
venv:
|
||||
make .venv3.$(minor)
|
||||
|
||||
clean:
|
||||
rm -fr $(venv)
|
||||
|
||||
install: venv install_dependencies
|
||||
build: install test
|
||||
scratch: clean install test
|
||||
|
||||
# [cgoutte@e490 tddevops]$ python3 -m venv .venv/3.9/
|
||||
# [cgoutte@e490 tddevops]$ source .venv/3.9/bin/activate
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
def test_import():
|
||||
import module
|
||||
|
||||
|
||||
def test_true():
|
||||
import module
|
||||
|
||||
assert module.true()
|
||||
|
||||
|
||||
def test_fasle():
|
||||
import module
|
||||
|
||||
assert not module.false()
|
Loading…
Reference in New Issue