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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux