Skip to content

Commit

Permalink
Rename pytest fixture name for consistency (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
yakimka authored Oct 9, 2024
1 parent 906209b commit 75c33ba
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ We follow [Semantic Versions](https://semver.org/).

## Version next

## Version 0.28.1

- Rename pytest fixture name for consistency

## Version 0.28.0

- Removed dead code
Expand Down
5 changes: 3 additions & 2 deletions picodi/integrations/_pytest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def pytest_configure(config: pytest.Config) -> None:
"markers", "picodi_override(dep, override): Picodi deps override"
)
config.addinivalue_line(
"markers", "init_dependencies(scope_class): Helper marker for initializing deps"
"markers",
"picodi_init_dependencies(scope_class): Helper marker for initializing deps",
)


Expand Down Expand Up @@ -93,7 +94,7 @@ def _picodi_override_setup(

@pytest.fixture()
def picodi_init_dependencies_kwargs(request: pytest.FixtureRequest) -> dict | None:
for marker in request.node.iter_markers(name="init_dependencies"):
for marker in request.node.iter_markers(name="picodi_init_dependencies"):
if marker.args:
raise ValueError(
"init_dependencies marker don't support positional arguments"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "picodi"
description = "Simple Dependency Injection for Python"
version = "0.28.0"
version = "0.28.1"
license = "MIT"
authors = [
"yakimka"
Expand Down
6 changes: 3 additions & 3 deletions tests/test_integrations/test_pytest_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def service(dependency=Provide(ged_dep)):
return dependency
@pytest.mark.init_dependencies
@pytest.mark.picodi_init_dependencies
def test_hello_default():
assert inited is True
assert service() == 42
Expand Down Expand Up @@ -320,7 +320,7 @@ def service(dependency=Provide(ged_dep)):
return dependency
@pytest.mark.init_dependencies
@pytest.mark.picodi_init_dependencies
def test_hello_default():
assert inited is True
assert service() == 42
Expand All @@ -345,7 +345,7 @@ def test_cant_use_init_dependencies_with_args(pytester):
from picodi import Provide, inject, dependency, SingletonScope
@pytest.mark.init_dependencies("position arg")
@pytest.mark.picodi_init_dependencies("position arg")
def test_hello_default():
pass
"""
Expand Down

0 comments on commit 75c33ba

Please sign in to comment.