Skip to content

Commit

Permalink
fixed failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mbway committed Mar 24, 2024
1 parent 87d629f commit 87d21a2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions tests/test_import_hook/test_project_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion tests/test_import_hook/test_rust_file_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 87d21a2

Please sign in to comment.