Skip to content

Commit

Permalink
ci: update tests to use pdm.pytest plugin (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
frostming authored Dec 14, 2023
1 parent 8ee85bb commit 7a32ebf
Show file tree
Hide file tree
Showing 4 changed files with 196 additions and 177 deletions.
101 changes: 73 additions & 28 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,10 @@ package-dir = "src"

[tool.pdm.dev-dependencies]
dev = [
"pdm>=2.8.0",
"pdm[pytest]>=2.8.0",
"pytest>=7.4.0",
"pkginfo>=1.9.6",
"pytest-cov>=4.1.0",
"click>=8.1.6",
"pre-commit>=3.5.0",
]

Expand Down
16 changes: 2 additions & 14 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
"""conftest"""
import shutil
from pathlib import Path
from typing import Any, Callable

import pytest
from click.testing import CliRunner, Result
from pdm.core import Core

pytest_plugins = ["pdm.pytest"]


@pytest.fixture(name="repo_path")
Expand Down Expand Up @@ -64,14 +63,3 @@ def fixture_data_base_path(tests_base_path: Path) -> Path:
Path to the 'tests/data' folder.
"""
return tests_base_path.joinpath("data").resolve()


@pytest.fixture(scope="session")
def invoke() -> Callable[..., Result]:
"""Wrapper for CLIRunner"""
runner = CliRunner(mix_stderr=False)

def caller(args: Any) -> Result:
return runner.invoke(Core(), args, prog_name="pdm", catch_exceptions=False)

return caller
Loading

0 comments on commit 7a32ebf

Please sign in to comment.