remove databases, use SQLAlechemy 2.0 instead
Among the many changes we switch to using SQLAlchemy's connection pool, which means we are no longer required to guard against multiple threads working on the database. All db funcs now receive a connection to use as their first argument, this allows the caller to control transaction & rollback behavior.
This commit is contained in:
parent
c63bee072f
commit
4981de4a04
12 changed files with 876 additions and 765 deletions
11
tests/test_models.py
Normal file
11
tests/test_models.py
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import pytest
|
||||
|
||||
from unwind import models
|
||||
|
||||
|
||||
@pytest.mark.parametrize("mapper", models.mapper_registry.mappers)
|
||||
def test_fields(mapper):
|
||||
"""Test that models.fields() matches exactly all table columns."""
|
||||
dcfields = {f.name for f in models.fields(mapper.class_)}
|
||||
mfields = {c.name for c in mapper.columns}
|
||||
assert dcfields == mfields
|
||||
Loading…
Add table
Add a link
Reference in a new issue