94
94
Whether to rebuild mupdf when we build PyMuPDF. Default is 1.
95
95
--gdb 0|1
96
96
Run tests under gdb. Requires user interaction.
97
+ --pytest-prefix <command>
98
+ Use specified prefix when running pytest. E.g. `gdb --args`.
97
99
--pybind 0|1
98
100
Experimental, for investigating
99
101
https://github.com/pymupdf/PyMuPDF/issues/3869. Runs run basic code
@@ -185,6 +187,7 @@ def main(argv):
185
187
implementations = 'r'
186
188
test_names = list ()
187
189
venv = 2
190
+ pytest_prefix = None
188
191
pybind = False
189
192
pytest_options = None
190
193
timeout = None
@@ -236,6 +239,8 @@ def main(argv):
236
239
value = next (args )
237
240
assert value in ('0' , '1' ), f'`-s` must be followed by `0` or `1`, not { value = } .'
238
241
os .environ ['PYMUPDF_SETUP_PY_LIMITED_API' ] = value
242
+ elif arg == '--pytest-prefix' :
243
+ pytest_prefix = next (args )
239
244
elif arg == '--pybind' :
240
245
pybind = int (next (args ))
241
246
elif arg == '--system-site-packages' :
@@ -312,6 +317,7 @@ def do_test():
312
317
pytest_options = pytest_options ,
313
318
timeout = timeout ,
314
319
gdb = gdb ,
320
+ pytest_prefix = pytest_prefix ,
315
321
test_fitz = test_fitz ,
316
322
pytest_k = pytest_k ,
317
323
pybind = pybind ,
@@ -603,6 +609,7 @@ def test(
603
609
pytest_options = None ,
604
610
timeout = None ,
605
611
gdb = False ,
612
+ pytest_prefix = None ,
606
613
test_fitz = True ,
607
614
pytest_k = None ,
608
615
pybind = False ,
@@ -624,6 +631,8 @@ def test(
624
631
See top-level option `-p`.
625
632
gdb:
626
633
See top-level option `--gdb`.
634
+ pytest_prefix:
635
+ See top-level option `--pytest-prefix`.
627
636
test_fitz:
628
637
See top-level option `-f`.
629
638
'''
@@ -732,6 +741,8 @@ def getmtime(path):
732
741
)
733
742
elif gdb :
734
743
command = f'{ python } { pymupdf_dir_rel } /tests/run_compound.py{ run_compound_args } gdb --args { python } -m pytest { pytest_options } { pytest_arg } '
744
+ elif pytest_prefix :
745
+ command = f'{ python } { pymupdf_dir_rel } /tests/run_compound.py{ run_compound_args } { pytest_prefix } { python } -m pytest { pytest_options } { pytest_arg } '
735
746
elif platform .system () == 'Windows' :
736
747
# `python -m pytest` doesn't seem to work.
737
748
command = f'{ python } { pymupdf_dir_rel } /tests/run_compound.py{ run_compound_args } pytest { pytest_options } { pytest_arg } '
0 commit comments