Skip to content

Commit

Permalink
Fix tests in AppVeyor
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavid committed Jul 20, 2022
1 parent 91c2195 commit 0d09ddf
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/conftest.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
from pathlib import Path
import platform

import pytest
import pygit2
from . import utils


@pytest.fixture(scope='session', autouse=True)
def disable_global_git_config():
"""
Do not use global config for better test reproducibility.
https://github.com/libgit2/pygit2/issues/989
"""
def global_git_config():
# Do not use global config for better test reproducibility.
# https://github.com/libgit2/pygit2/issues/989
levels = [pygit2.GIT_CONFIG_LEVEL_GLOBAL,
pygit2.GIT_CONFIG_LEVEL_XDG,
pygit2.GIT_CONFIG_LEVEL_SYSTEM]
for level in levels:
pygit2.settings.search_path[level] = ""

# Fix tests running in AppVeyor
if platform.system() == 'Windows':
pygit2.option(pygit2.GIT_OPT_SET_OWNER_VALIDATION, 0)


@pytest.fixture
def pygit2_empty_key():
Expand Down

0 comments on commit 0d09ddf

Please sign in to comment.