cunybpl / aiodal

async data access layer and related tools for sqlalchemy core
0 stars 0 forks source link

condense pytest fixtures for async engine #9

Closed bsnacks000 closed 11 months ago

bsnacks000 commented 11 months ago

I am realizing its kind of pointless to have both engine_extra_kwargs and engine_json_serializer / engine_echo... we should just have it set up like this:

@pytest.fixture(scope="session") 
def engine_kwargs(): 
    return {
         "json_serializer": helpers.json_serializer, 
         "echo": False
    }

@pytest.fixture(scope="session")
def async_engine(
    engine_uri: str,
    engine_kwargs: Dict[str, Any],
) -> AsyncEngine:
    return create_async_engine(
        url=engine_uri,
        **engine_kwargs
    )

@kgasiorowski I think we can add this into #8 since we are trying to cover this module anyway

bsnacks000 commented 11 months ago

closed from dccfb72..fc6f5ec