[Libosinfo] [osinfo-db PATCH v2 5/7] tests: Add INTERNAL_OSINFO_DB_DATA_SRC_DIR to conftest

Fabiano Fidêncio fidencio at redhat.com
Tue Apr 23 15:20:38 UTC 2019


This new environmnet variable represents the source data dir. It's
important to note, although the limitation was not introduced in this
patch, that running pytest-3 locally will only work when not doing
out-of-tree builds.

Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
---
 tests/conftest.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/conftest.py b/tests/conftest.py
index a6cb20a..9debe85 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -17,6 +17,11 @@ def pytest_configure(config):
         os.environ[key] = os.path.realpath(os.path.join(
             os.path.dirname(__file__), "..", "data"))
 
+    key = "INTERNAL_OSINFO_DB_DATA_SRC_DIR"
+    if key not in os.environ:
+        os.environ[key] = os.path.realpath(os.path.join(
+            os.path.dirname(__file__), "..", "data"))
+
     # Needed for test reproducibility on any system not using a UTF-8 locale
     locale.setlocale(locale.LC_ALL, 'C')
     locale.setlocale(locale.LC_CTYPE, 'en_US.UTF-8')
-- 
2.21.0




More information about the Libosinfo mailing list