swh.objstorage.pytest_plugin module#

swh.objstorage.pytest_plugin.swh_objstorage_config()[source]#

Fixture that returns a dictionary containing the configuration required to instantiate an object storage.

Unless the fixture gets overridden, the configuration for creating an object storage in memory is returned.

See swh.objstorage.factory.get_objstorage() for more details.

swh.objstorage.pytest_plugin.swh_objstorage(swh_objstorage_config)[source]#

Fixture that instantiates an object storage based on the configuration returned by the swh_objstorage_config fixture.

swh.objstorage.pytest_plugin.statsd()[source]#

Simple fixture giving a Statsd instance suitable for tests

It will replace the swh.core.statsd.statsd instance with this one.

The Statsd instance uses a FakeSocket as .socket attribute in which one can get the accumulated statsd messages in a deque in .socket.payloads.