From: Colin Watson <cjwatson@debian.org>
Date: Tue, 25 Mar 2025 19:09:17 +0000
Subject: tests/examples: Run programs using matching Python interpreter

Last-Update: 2025-03-25
---
 tests/examples/test_djvu2png.py       | 2 ++
 tests/examples/test_djvu_crop_text.py | 2 ++
 tests/examples/test_djvu_dump_text.py | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/tests/examples/test_djvu2png.py b/tests/examples/test_djvu2png.py
index 586399f..2f9f6cc 100644
--- a/tests/examples/test_djvu2png.py
+++ b/tests/examples/test_djvu2png.py
@@ -13,6 +13,7 @@
 
 import os
 import subprocess
+import sys
 from importlib.util import find_spec
 from tempfile import NamedTemporaryFile
 from unittest import SkipTest
@@ -32,6 +33,7 @@ class Djvu2PngTestCase(TestCase):
         with NamedTemporaryFile(suffix='.png') as outfile:
             subprocess.run(
                 [
+                    sys.executable,
                     os.path.join(EXAMPLES, 'djvu2png'),
                     f'--{mode}',
                     os.path.join(IMAGES, 'test1.djvu'),
diff --git a/tests/examples/test_djvu_crop_text.py b/tests/examples/test_djvu_crop_text.py
index e1d3257..c81778f 100644
--- a/tests/examples/test_djvu_crop_text.py
+++ b/tests/examples/test_djvu_crop_text.py
@@ -13,6 +13,7 @@
 
 import os
 import subprocess
+import sys
 
 from tests.tools import EXAMPLES, IMAGES, TestCase
 
@@ -21,6 +22,7 @@ class DjvuCropTextTestCase(TestCase):
     def test_djvu_dump_text(self):
         stdout = subprocess.check_output(
             [
+                sys.executable,
                 os.path.join(EXAMPLES, 'djvu-crop-text'),
                 os.path.join(IMAGES, 'test0.djvu'),
             ],
diff --git a/tests/examples/test_djvu_dump_text.py b/tests/examples/test_djvu_dump_text.py
index 04d7d24..ee45d5c 100644
--- a/tests/examples/test_djvu_dump_text.py
+++ b/tests/examples/test_djvu_dump_text.py
@@ -13,6 +13,7 @@
 
 import os
 import subprocess
+import sys
 
 from tests.tools import EXAMPLES, IMAGES, TestCase
 
@@ -21,6 +22,7 @@ class DjvuDumpTextTestCase(TestCase):
     def test_djvu_dump_text(self):
         stdout = subprocess.check_output(
             [
+                sys.executable,
                 os.path.join(EXAMPLES, 'djvu-dump-text'),
                 os.path.join(IMAGES, 'test0.djvu'),
             ]
