Skip to content

Commit

Permalink
proofread
Browse files Browse the repository at this point in the history
  • Loading branch information
biniona committed Oct 1, 2024
1 parent b53d559 commit 22c73fb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion minject/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ async def _ainit_object(self, obj: T_co, registry_impl: "Registry") -> None: #
"""
init_kwargs = {}
for name_, value in self._bindings.items():
# the specific deferred value checks if they are async or
init_kwargs[name_] = await registry_impl._aresolve(value)
self._cls.__init__(obj, **init_kwargs)

Expand Down
3 changes: 3 additions & 0 deletions minject/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ def __contains__(self, key: K_contra) -> bool:


class _AsyncContext(Protocol):
"""
Protocol for any object that can be used as an async context manager.
"""
async def __aenter__(self: Self) -> Self:
...

Expand Down
3 changes: 0 additions & 3 deletions tests/test_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
from random import shuffle
from typing import Sequence

import pytest

import tests.test_registry_helpers as helpers
from minject.inject import (
_RegistryConfig,
Expand Down Expand Up @@ -458,7 +456,6 @@ def get_object(i):
self.assertEqual(n_objects, len(self.registry))
self.assertEqual(n_objects, len(self.registry._by_name))

@pytest.mark.skip(reason="This test is flaky")
def test_concurrent_lazy_init(self) -> None:
"""
Test lazy initialization of singletons in a concurrent environment always returns the same object
Expand Down

0 comments on commit 22c73fb

Please sign in to comment.