Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving pytest plugin into the package namespace #30

Merged
merged 3 commits into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
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
19 changes: 0 additions & 19 deletions _logot_pytest.py

This file was deleted.

13 changes: 13 additions & 0 deletions logot/_pytest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from __future__ import annotations

from collections.abc import Generator

import pytest

from logot._logot import Logot


@pytest.fixture()
def logot() -> Generator[Logot, None, None]:
with Logot().capturing() as logot:
yield logot
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ classifiers = [
"Topic :: System :: Logging",
"Typing :: Typed",
]
packages = [{ include = "logot" }, { include = "_logot_pytest.py" }]
packages = [{ include = "logot" }]

[tool.poetry.dependencies]
python = "^3.8"
Expand All @@ -43,7 +43,7 @@ sphinx = { version = "7.2.6", markers = "python_version >= '3.12'" }
sphinx-autobuild = { version = "*", markers = "python_version >= '3.12'" }

[tool.poetry.plugins.pytest11]
logot = "_logot_pytest"
logot = "logot._pytest"

[tool.coverage.run]
source = ["logot", "tests"]
Expand Down