Skip to content

Commit

Permalink
fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
mbway committed Dec 7, 2024
1 parent f5ae65c commit 15d9086
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/test_import_hook/test_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,20 @@
log = logging.getLogger(__name__)


@pytest.mark.skipif(os.linesep != "\n", reason="hashes calculated with \\n line endings")
def test_maturin_unchanged() -> None:
"""if new options have been added to maturin then the import hook needs to be updated to match"""
env = {"PATH": os.environ["PATH"], "COLUMNS": "120"}

build_help = subprocess.check_output("stty rows 50 cols 120; maturin build --help", shell=True, env=env) # noqa: S602
assert hashlib.sha1(build_help).hexdigest() == "ea47a884c90c9376047687aed98ab1dca29b433a"
assert hashlib.sha1(build_help).hexdigest() == "ea47a884c90c9376047687aed98ab1dca29b433a", (
f"hashes don't match. build_help = {build_help!r}"
)

develop_help = subprocess.check_output("stty rows 50 cols 120; maturin develop --help", shell=True, env=env) # noqa: S602
assert hashlib.sha1(develop_help).hexdigest() == "ad7036a829c6801224933d589b1f9848678c9458"
assert hashlib.sha1(develop_help).hexdigest() == "ad7036a829c6801224933d589b1f9848678c9458", (
f"hashes don't match. develop_help = {develop_help!r}"
)


def test_settings() -> None:
Expand Down

0 comments on commit 15d9086

Please sign in to comment.