Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions test/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import platform
import tempfile
from pathlib import Path

import pytest
Expand All @@ -13,10 +14,22 @@
# interference with tests.
# This ignores ~/.hgrc
os.environ["HGRCPATH"] = ""
# This ignores system-level git config (eg: in /etc). There apperas to be
# no way to ignore ~/.gitconfig other than overriding $HOME, which is overkill.
# This ignores system-level git config (eg: in /etc).
os.environ["GIT_CONFIG_NOSYSTEM"] = "1"


@pytest.fixture(scope="session", autouse=True)
def git_global_config():
# run-task writes to the global git config, so point it at a real
# (writable) empty file instead of ~/.gitconfig.
fd, path = tempfile.mkstemp(prefix="taskgraph-gitconfig-")
os.close(fd)
os.environ["GIT_CONFIG_GLOBAL"] = path
yield
del os.environ["GIT_CONFIG_GLOBAL"]
os.unlink(path)


# Some of the tests marked with this may be fixable on Windows; we should
# look into these in more depth at some point.
nowin = pytest.mark.skipif(
Expand Down
Loading