Check makefile is ok and run test

This commit is contained in:
Colin Goutte 2024-05-02 14:00:18 +02:00
parent a32ec91610
commit 18464e0b86
4 changed files with 60 additions and 0 deletions

1
multiple_python_version/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.venv*

View File

@ -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

View File

View File

@ -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()