aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Harder <radhermit@gmail.com>2021-03-07 13:41:54 -0700
committerTim Harder <radhermit@gmail.com>2021-03-07 13:49:32 -0700
commita3e183e6d769b8d22f8183b0b7a7323854577d00 (patch)
treeef9ebe5e37642a2de839e83fb4e57b870f6c53e5 /tests
parentpkgdev commit: support multiple -m/--message options (diff)
downloadpkgdev-a3e183e6d769b8d22f8183b0b7a7323854577d00.tar.gz
pkgdev-a3e183e6d769b8d22f8183b0b7a7323854577d00.tar.bz2
pkgdev-a3e183e6d769b8d22f8183b0b7a7323854577d00.zip
tests: make tests fail if generated modules don't exist
To try to force a more consistent test environment.
Diffstat (limited to 'tests')
-rw-r--r--tests/scripts/test_pkgdev.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/scripts/test_pkgdev.py b/tests/scripts/test_pkgdev.py
index d6147ce..e161498 100644
--- a/tests/scripts/test_pkgdev.py
+++ b/tests/scripts/test_pkgdev.py
@@ -1,3 +1,4 @@
+import importlib
from functools import partial
from unittest.mock import patch
@@ -50,3 +51,13 @@ class TestPkgdev:
assert excinfo.value.code == 0
out, err = capsys.readouterr()
assert out.startswith(project)
+
+ def test_installed(self):
+ """Verify tests are running in environment where generated modules exist."""
+ try:
+ importlib.import_module(f'{project}._verinfo')
+ except ImportError:
+ pytest.fail(
+ 'not running against installed or released package\n'
+ '(use `setup.py test` when running from git)'
+ )