From 87d21a2cbb99d39da66cc1d7317c89ffee7b4c31 Mon Sep 17 00:00:00 2001 From: Matthew Broadway Date: Sun, 24 Mar 2024 20:37:49 +0000 Subject: [PATCH] fixed failing tests --- .../test_import_hook/test_project_importer.py | 19 ++++++++++--------- .../test_rust_file_importer.py | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/test_import_hook/test_project_importer.py b/tests/test_import_hook/test_project_importer.py index b519517..f40556d 100644 --- a/tests/test_import_hook/test_project_importer.py +++ b/tests/test_import_hook/test_project_importer.py @@ -449,16 +449,17 @@ def test_rebuild_on_change_to_path_dependency(workspace: Path) -> None: _install_editable(project_dir) assert _is_editable_installed_correctly(project_name, project_dir, True) - check_installed = dedent(f"""\ - {IMPORT_HOOK_HEADER} - - import pyo3_mixed_with_path_dep + check_installed = "{}\n{}".format( + IMPORT_HOOK_HEADER, + dedent("""\ + import pyo3_mixed_with_path_dep - assert pyo3_mixed_with_path_dep.get_42() == 42, 'get_42 did not return 42' + assert pyo3_mixed_with_path_dep.get_42() == 42, 'get_42 did not return 42' - print('21 is half 42:', pyo3_mixed_with_path_dep.is_half(21, 42)) - print('21 is half 63:', pyo3_mixed_with_path_dep.is_half(21, 63)) - """) + print('21 is half 42:', pyo3_mixed_with_path_dep.is_half(21, 42)) + print('21 is half 63:', pyo3_mixed_with_path_dep.is_half(21, 63)) + """), + ) output1, duration1 = run_python_code(check_installed) assert "21 is half 42: True" in output1 @@ -1066,7 +1067,7 @@ def test_maturin_detection(self, workspace: Path) -> None: assert output == ( 'building "test_project"\n' "caught MaturinError('unsupported maturin version: (0, 1, 2). " - "Import hook requires >=(1, 4, 0),<(2, 0, 0)')\n" + "Import hook requires >=(1, 5, 0),<(2, 0, 0)')\n" ) @pytest.mark.parametrize("is_mixed", [False, True]) diff --git a/tests/test_import_hook/test_rust_file_importer.py b/tests/test_import_hook/test_rust_file_importer.py index 82da662..b734ee5 100644 --- a/tests/test_import_hook/test_rust_file_importer.py +++ b/tests/test_import_hook/test_rust_file_importer.py @@ -632,7 +632,7 @@ def test_maturin_detection(self, workspace: Path) -> None: assert output == ( 'building "my_script"\n' "caught MaturinError('unsupported maturin version: (0, 1, 2). " - "Import hook requires >=(1, 4, 0),<(2, 0, 0)')\n" + "Import hook requires >=(1, 5, 0),<(2, 0, 0)')\n" ) def test_default_rebuild(self, workspace: Path) -> None: