mirror of
https://github.com/d3vyce/fastapi-toolsets.git
synced 2026-03-02 01:10:47 +01:00
fix: pytest import when not using register_fixtures (#5)
This commit is contained in:
@@ -5,7 +5,6 @@ from .fixtures import (
|
|||||||
load_fixtures,
|
load_fixtures,
|
||||||
load_fixtures_by_context,
|
load_fixtures_by_context,
|
||||||
)
|
)
|
||||||
from .pytest_plugin import register_fixtures
|
|
||||||
from .utils import get_obj_by_attr
|
from .utils import get_obj_by_attr
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
@@ -17,3 +16,12 @@ __all__ = [
|
|||||||
"load_fixtures_by_context",
|
"load_fixtures_by_context",
|
||||||
"register_fixtures",
|
"register_fixtures",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
# We lazy-load register_fixtures to avoid needing pytest when using fixtures CLI
|
||||||
|
def __getattr__(name: str):
|
||||||
|
if name == "register_fixtures":
|
||||||
|
from .pytest_plugin import register_fixtures
|
||||||
|
|
||||||
|
return register_fixtures
|
||||||
|
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
||||||
|
|||||||
Reference in New Issue
Block a user