File: 0001-test-data-location.patch

package info (click to toggle)
translate-toolkit 3.16.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,412 kB
  • sloc: python: 64,288; sh: 1,406; makefile: 185; xml: 48
file content (27 lines) | stat: -rw-r--r-- 1,002 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From: Stuart Prescott <stuart@debian.org>
Date: Fri, 14 Mar 2025 23:52:43 +1100
Subject: Allow test data location to be set externally

 Existing test suite has restrictions on locations of data files compared
 to the location of the tests that makes in-place testing hard. This patch
 adds an environment variable to override the default test location.
---
 tests/translate/tools/test_poterminology.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/translate/tools/test_poterminology.py b/tests/translate/tools/test_poterminology.py
index 133e0f6..ca7639a 100644
--- a/tests/translate/tools/test_poterminology.py
+++ b/tests/translate/tools/test_poterminology.py
@@ -4,6 +4,11 @@ from translate.storage import factory
 from translate.tools import poterminology
 
 base_dir = Path(__file__).parent.parent.parent
+
+import os
+if "TTKIT_TEST_DATA" in os.environ:
+    base_dir = Path(os.environ["TTKIT_TEST_DATA"])
+
 sample_po_file = base_dir / "xliff_conformance" / "af-pootle.po"