Insert data into empty test databases on demand using decorators
Many tests require existing data to be in the database. We need to have a good way of adding the same information every time. However, we cannot add this information for each test, because some of the tests should start with empty tables instead. Therefore, we need to add them on-demand. We can do that with the pytest.mark decorator. For example the following function needs data inside the entities and assets tables.
@pytest.mark.tables(["entities", "assets"])
def my_test_function():
...
\fyi @all