Skip to content

Commit

Permalink
fix: compat
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-auchincloss committed Apr 28, 2024
1 parent f4a0a0d commit c976b6e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
4 changes: 3 additions & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ def test_stale(new_tmp_dir):
str(dest),
)

src.write_text("now stale")
with src.open("w") as f:
f.write("now stale")

assert stale(
str(src),
str(dest),
Expand Down
26 changes: 12 additions & 14 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,18 @@ def platformgetter():
expect_brew = "/usr/local" if arch == "x86_64" else "/opt/homebrew"

try:
with (
patch("hatch_cython.utils.plat", platformgetter),
patch("hatch_cython.config.defaults.plat", platformgetter),
patch("hatch_cython.config.platform.plat", platformgetter),
patch("hatch_cython.plugin.plat", platformgetter),
patch("hatch_cython.utils.aarch", aarchgetter),
patch("hatch_cython.config.defaults.aarch", aarchgetter),
patch("hatch_cython.config.platform.aarch", aarchgetter),
):
if brew:
with patch_brew(expect_brew):
yield
else:
yield
with patch("hatch_cython.utils.plat", platformgetter):
with patch("hatch_cython.config.defaults.plat", platformgetter):
with patch("hatch_cython.config.platform.plat", platformgetter):
with patch("hatch_cython.plugin.plat", platformgetter):
with patch("hatch_cython.utils.aarch", aarchgetter):
with patch("hatch_cython.config.defaults.aarch", aarchgetter):
with patch("hatch_cython.config.platform.aarch", aarchgetter):
if brew:
with patch_brew(expect_brew):
yield
else:
yield
finally:
print(f"Clean {arch}-{platform}") # noqa: T201
del aarchgetter, platformgetter
Expand Down

0 comments on commit c976b6e

Please sign in to comment.