Skip to content

Commit 5e83b07

Browse files
authored
chore: update db_migration fixture documentation
1 parent c657fa1 commit 5e83b07

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,22 @@ A session scope fixture that runs `alembic upgrade` at test session setup and
211211

212212
It depends on `alembic_ini_path` fixture to get the path of `alembic.ini` file.
213213

214-
To use:
214+
To use in a test or test module:
215215

216216
```python
217217
from pytest import mark
218218

219219
pytestmark = mark.usefixtures("db_migration")
220220
```
221221

222+
To use globally, add to [pytest options](https://docs.pytest.org/en/stable/reference.html#confval-usefixtures):
223+
224+
```ini
225+
[pytest]
226+
usefixtures =
227+
db_migration
228+
```
229+
222230
### `alembic_ini_path`
223231

224232
It returns the path of `alembic.ini` configuration file. By default, it returns

0 commit comments

Comments
 (0)