File: test-interpreter.patch

package info (click to toggle)
plastex 2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,740 kB
  • sloc: python: 20,923; xml: 18,043; ansic: 46; makefile: 34; sh: 23
file content (51 lines) | stat: -rw-r--r-- 1,855 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Description: Control binary call for running tests
Author: Stuart Prescott <stuart@debian.org>
Forwarded: https://github.com/plastex/plastex/pull/135
diff --git a/unittests/tikzpicture.py b/unittests/tikzpicture.py
index 7498801..8108636 100644
--- a/unittests/tikzpicture.py
+++ b/unittests/tikzpicture.py
@@ -1,4 +1,5 @@
 import os
+import shlex
 import subprocess
 from bs4 import BeautifulSoup 
 try:
@@ -182,9 +183,13 @@ def test_functional(tmpdir):
             A \\rar & B
     \end{tikzcd}
     \end{document}""")
+    commandline = os.environ.get('PLASTEX_COMMANDLINE', 'plastex')
+    commandline = shlex.split(commandline)
     with tmpdir.as_cwd():
-        subprocess.call(
-            ['plastex', '--renderer', 'HTML5', 'test.tex'])
+        subprocess.call(commandline + [
+            '--renderer', 'HTML5',
+            'test.tex'
+        ])
     assert os.path.isdir(str(tmpdir.join('test')))
     assert os.path.isfile(str(tmpdir.join('test', 'index.html')))
     soup = BeautifulSoup(tmpdir.join('test', 'index.html').read(), "html.parser")
commit d23b89b9eb2d3584be39dd60bf5ccaaa10e7f4a9
Author: Stuart Prescott <stuart@debian.org>
Date:   Thu Dec 12 14:03:11 2019 +1100

    Fail test if runing plastex failed
    
    The success of the call to 'plastex' needs to be checked to catch test
    failures as early as possible.

diff --git a/unittests/tikzpicture.py b/unittests/tikzpicture.py
index 8108636..a4359eb 100644
--- a/unittests/tikzpicture.py
+++ b/unittests/tikzpicture.py
@@ -186,7 +186,7 @@ def test_functional(tmpdir):
     commandline = os.environ.get('PLASTEX_COMMANDLINE', 'plastex')
     commandline = shlex.split(commandline)
     with tmpdir.as_cwd():
-        subprocess.call(commandline + [
+        subprocess.check_call(commandline + [
             '--renderer', 'HTML5',
             'test.tex'
         ])