Skip to content

Commit

Permalink
test(gitconfig): use pytrest-gitconfig to avoid run environment git…
Browse files Browse the repository at this point in the history
… setting side-effects
  • Loading branch information
noirbizarre committed Nov 27, 2024
1 parent d5d5c23 commit 4f088e7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
cache: "pip"
- name: Install Dependencies
run: |
python -m pip install -U pip pytest setuptools editables
python -m pip install -U pip pytest setuptools editables pytest-gitconfig
pip install .
- name: Install Mercurial
shell: bash
Expand All @@ -59,6 +59,4 @@ jobs:
echo "username = \"John Doe <[email protected]>\"" >> ~/.hgrc
- name: Run Tests
run: |
git config --global user.name "John Doe"
git config --global user.email "[email protected]"
pytest -vvv tests
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ source-includes = ["tests"]
test = [
"pytest",
"pytest-cov",
"pytest-gitconfig",
"pytest-xdist",
"setuptools",
]
Expand All @@ -109,6 +110,7 @@ docs = [
[tool.pdm.scripts]
build = "python scripts/build.py"
docs = "mkdocs serve"
test = "pytest"

[tool.coverage.report]
exclude_lines = [
Expand All @@ -133,4 +135,4 @@ namespace_packages = true

[[tool.mypy.overrides]]
module = "pdm.backend._vendor.*"
ignore_errors = true
ignore_errors = true
2 changes: 0 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ def dist(tmp_path: Path) -> Path:
@pytest.fixture
def scm(fixture_project: Path) -> None:
subprocess.check_call(["git", "init"])
subprocess.check_call(["git", "config", "user.email", "[email protected]"])
subprocess.check_call(["git", "config", "user.name", "Name"])
subprocess.check_call(["git", "add", "."])
subprocess.check_call(["git", "commit", "-m", "initial commit"])
subprocess.check_call(["git", "tag", "-a", "0.1.0", "-m", "version 0.1.0"])

0 comments on commit 4f088e7

Please sign in to comment.