Hi there,
I have a use case where I will only know the port to a running instance of mongo at runtime (and I'm able to get that via a session-scoped fixture). I would like to be able to tell pytest-mongo to use such a port. By looking at the documentation, it seems that there isn't a supported way of passing the port (or other configuration) to pytest-mongo at runtime. That would really be useful.
A way I can think of providing such a feature is to allow users to override a fixture that will give the configuration necessary. For example:
@pyest.fixture(scope='session')
def pytest_mongo_conf(my, own, required, fixtures, here):
... # Get host and port from other fixtures
# Options defined in the returned dictionary would override their previous (or default) values
return {
'host': host,
'port': port,
}
Hi there,
I have a use case where I will only know the port to a running instance of mongo at runtime (and I'm able to get that via a session-scoped fixture). I would like to be able to tell pytest-mongo to use such a port. By looking at the documentation, it seems that there isn't a supported way of passing the port (or other configuration) to pytest-mongo at runtime. That would really be useful.
A way I can think of providing such a feature is to allow users to override a fixture that will give the configuration necessary. For example: