Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
ambv committed Jul 31, 2024
1 parent 7b74f42 commit 5db1d86
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/magicdata/Include/internal/pycore_magic_number.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// copied from cpython bd3d31f380cd451a4ab6da5fbfde463fed95b5b5
// ...

#ifndef Py_INTERNAL_MAGIC_NUMBER_H
#define Py_INTERNAL_MAGIC_NUMBER_H

#define PYC_MAGIC_NUMBER 3603

#endif // !Py_INTERNAL_MAGIC_NUMBER_H

// ...
15 changes: 15 additions & 0 deletions tests/test_run_release.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
from pathlib import Path
from typing import cast

import pytest

import run_release
from release import ReleaseShelf, Tag


@pytest.mark.parametrize(
Expand All @@ -22,3 +26,14 @@ def test_invalid_extract_github_owner() -> None:
"https://example.com",
):
run_release.extract_github_owner("https://example.com")


def test_check_magic_number() -> None:
db = {
"release": Tag("3.13.0rc1"),
"git_repo": str(Path(__file__).parent / "magicdata"),
}
with pytest.raises(
run_release.ReleaseException, match="Magic numbers in .* don't match"
):
run_release.check_magic_number(cast(ReleaseShelf, db))

0 comments on commit 5db1d86

Please sign in to comment.