diff --git a/scripts/sysinstall.py b/scripts/sysinstall.py index 501420f8f..d129f0e63 100755 --- a/scripts/sysinstall.py +++ b/scripts/sysinstall.py @@ -190,8 +190,8 @@ def main(): sudo = '' if root == '/': sudo = f'sudo PATH={os.environ["PATH"]} ' - def run(command): - return run_command(command, doit=mupdf_do) + def run(command, env_extra=None): + return run_command(command, doit=mupdf_do, env_extra=env_extra) # Get MuPDF from git if specified. # if mupdf_git: @@ -334,8 +334,8 @@ def run(command): # Run pytest tests. # log('## Run PyMuPDF pytest tests.') - def run(command): - return run_command(command, doit=pytest_do) + def run(command, env_extra=None): + return run_command(command, doit=pytest_do, env_extra=env_extra) import gh_release if pip == 'venv': # Create venv. @@ -387,12 +387,12 @@ def run(command): command += f' -p {shlex.quote(pytest_args)}' if pytest_do: command += ' test' - run(command) + run(command, env_extra=dict(PYMUPDF_SYSINSTALL_TEST='1')) -def run_command(command, capture=False, check=True, doit=True): +def run_command(command, capture=False, check=True, doit=True, env_extra=None): if doit: - return pipcl.run(command, capture=capture, check=check, caller=2) + return pipcl.run(command, capture=capture, check=check, caller=2, env_extra=env_extra) else: log(f'## Would have run: {command}', caller=2) diff --git a/tests/test_pixmap.py b/tests/test_pixmap.py index 83d009167..8f55b3f0f 100644 --- a/tests/test_pixmap.py +++ b/tests/test_pixmap.py @@ -426,4 +426,9 @@ def test_3854(): rms = gentle_compare.pixmaps_rms(pixmap, pixmap_expected) print(f'{rms=}.') - assert rms == 0 + if os.environ.get('PYMUPDF_SYSINSTALL_TEST') == '1': + # MuPDF using external third-party libs gives slightly different + # behaviour. + assert rms < 1 + else: + assert rms == 0 diff --git a/tests/test_pylint.py b/tests/test_pylint.py index ffed9944b..541d9e4ce 100644 --- a/tests/test_pylint.py +++ b/tests/test_pylint.py @@ -36,6 +36,7 @@ def test_pylint(): W0622: Redefining built-in 'open' (redefined-builtin) W1309: Using an f-string that does not have any interpolated variables (f-string-without-interpolation) R1734: Consider using [] instead of list() (use-list-literal) + R1727: Boolean condition '0 and g_exceptions_verbose' will always evaluate to '0' (condition-evals-to-constant) ''' )