File: 0003-test-installed-scripts.patch

package info (click to toggle)
translate-toolkit 3.15.6-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 7,320 kB
  • sloc: python: 64,041; sh: 1,406; makefile: 185; xml: 48
file content (37 lines) | stat: -rw-r--r-- 1,204 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
28
29
30
31
32
33
34
35
36
37
From: Debian l10n developers <debian-l10n-devel@lists.alioth.debian.org>
Date: Fri, 14 Mar 2025 23:52:43 +1100
Subject: test-installed-scripts

---
 tests/translate/tools/test_help.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/translate/tools/test_help.py b/tests/translate/tools/test_help.py
index 255790c..c555cf1 100644
--- a/tests/translate/tools/test_help.py
+++ b/tests/translate/tools/test_help.py
@@ -5,8 +5,15 @@ from pathlib import Path
 import pytest
 
 location = Path(__file__).parent.parent.parent.parent / "translate" / "tools"
+ext = ".py"
 
+import os
+if "TTKIT_TEST_PATH" in os.environ:
+    location = Path(os.environ["TTKIT_TEST_PATH"])
+    ext = ""
 
+
+@pytest.mark.skipif("TTKIT_SKIP_COMMANDS" in os.environ, reason="Skip testing command line tools")
 @pytest.mark.parametrize(
     "command",
     [
@@ -30,7 +37,7 @@ location = Path(__file__).parent.parent.parent.parent / "translate" / "tools"
 )
 def test_help(command: str):
     stdout = subprocess.check_output(
-        [sys.executable, str(location / f"{command}.py"), "--help"],
+        [sys.executable, str(location / f"{command}{ext}"), "--help"],
         text=True,
     )