diff --git a/pyproject.toml b/pyproject.toml index e688d178..1a5a95a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,6 +11,11 @@ dependency-versions = "pinned" environment = {LIBGIT2_VERSION="1.9.1", LIBSSH2_VERSION="1.11.1", OPENSSL_VERSION="3.3.3", LIBGIT2="/project/ci"} before-all = "sh build.sh" +test-command = "pytest" +test-sources = ["test"] +before-test = "pip install -r {project}/requirements-test.txt" +# Will avoid testing on emulated architectures (specifically ppc64le) +test-skip = "*-*linux_ppc64le" [tool.cibuildwheel.linux] repair-wheel-command = "LD_LIBRARY_PATH=/project/ci/lib64 auditwheel repair -w {dest_dir} {wheel}" diff --git a/test/__init__.py b/test/__init__.py index 7fb15c4f..53a1b230 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -30,5 +30,6 @@ import sys cwd = os.getcwd() -sys.path.remove(cwd) -sys.path.append(cwd) +if cwd in sys.path: + sys.path.remove(cwd) + sys.path.append(cwd) diff --git a/test/conftest.py b/test/conftest.py index 7b0d4149..69d3e638 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -1,4 +1,3 @@ -import platform from collections.abc import Generator from pathlib import Path @@ -22,11 +21,6 @@ def global_git_config() -> None: for level in levels: pygit2.settings.search_path[level] = '' - # Fix tests running in Windows - # XXX Still needed now we have moved to GitHub CI? - if platform.system() == 'Windows': - pygit2.option(pygit2.enums.Option.SET_OWNER_VALIDATION, False) - @pytest.fixture def pygit2_empty_key() -> tuple[Path, str, str]: diff --git a/test/test_refs.py b/test/test_refs.py index 9ad830b7..276a0cdb 100644 --- a/test/test_refs.py +++ b/test/test_refs.py @@ -595,7 +595,10 @@ def test_set_target_with_message(testrepo: Repository) -> None: assert reference.raw_target == b'refs/heads/i18n' first = list(reference.log())[0] assert first.message == msg - assert first.committer == sig + # Signature.time and Signature.encoding may not be equal. + # Here we only care that the name and email are correctly set. + assert first.committer.name == sig.name + assert first.committer.email == sig.email def test_delete(testrepo: Repository) -> None: