diff --git a/MakefileVenv b/MakefileVenv index 47017b8..518b8a0 100644 --- a/MakefileVenv +++ b/MakefileVenv @@ -19,7 +19,7 @@ install: $(python) -m pip install -r requirements.txt test: - $(python) -m unittest --discover . + already_in_venv=True $(python) -m unittest discover . run: diff --git a/test_guidelines.py b/test_guidelines.py index aef608a..b203c73 100644 --- a/test_guidelines.py +++ b/test_guidelines.py @@ -2,8 +2,10 @@ Testing guidelines and install """ +import os + import unittest -from subprocess import run +from subprocess import run, CalledProcessError import pathlib @@ -20,8 +22,9 @@ class TestGuidelines(unittest.TestCase): target = pathlib.Path(root_dir) / "requirements.txt" assert target.exists() - assert target.isFile() + assert target.is_file() + @unittest.skipIf(os.environ.get("already_in_venv"), "Avoid self call infinite loop") def test_environment(self): """We want to make sure that the project is virtualenv compatible. we may provie and extra makefile for that (and automate build phase) @@ -33,6 +36,6 @@ class TestGuidelines(unittest.TestCase): with self.subTest(setp=step): try: run(["make", *venv, step], check=True) - except Exception as E: + except CalledProcessError as E: print(E.output) raise