Skip to content
Open
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
8 changes: 6 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,9 +14,12 @@
# 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"
# run-task writes to the global git config, so point it at a real
# (writable) empty file instead of ~/.gitconfig.
git_global = tempfile.NamedTemporaryFile(prefix="taskgraph-gitconfig-")
Copy link
Copy Markdown
Contributor

@jcristau jcristau Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to move that to a (autouse/session-scope?) fixture so you can delete the file at the end?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK it'll get deleted at the end when it gets GC'ed on interpreter exit.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, right.

os.environ["GIT_CONFIG_GLOBAL"] = git_global.name

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