File: tests-Fix-warning-on-deprecated-declarative_base.patch

package info (click to toggle)
wtforms-json 0.3.5-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 260 kB
  • sloc: python: 819; makefile: 140; sh: 11
file content (28 lines) | stat: -rw-r--r-- 947 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From: Carsten Schoenert <c.schoenert@t-online.de>
Date: Sat, 29 Jun 2024 09:00:08 +0200
Subject: tests: Fix warning on deprecated declarative_base()

The function declarative_base() is now available via
sqlalchemy.orm.declarative_base().
---
 tests/test_wtforms_alchemy.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/test_wtforms_alchemy.py b/tests/test_wtforms_alchemy.py
index 3c27338..03c2f3b 100644
--- a/tests/test_wtforms_alchemy.py
+++ b/tests/test_wtforms_alchemy.py
@@ -1,11 +1,11 @@
 import sqlalchemy as sa
 from sqlalchemy import create_engine
-from sqlalchemy.ext.declarative import declarative_base
+from sqlalchemy.orm import declarative_base
 from sqlalchemy.orm import sessionmaker
 from wtforms_alchemy import ModelForm
 
 engine = create_engine('sqlite:///:memory:')
-Base = declarative_base(engine)
+Base = sa.orm.declarative_base()
 Session = sessionmaker(bind=engine)
 session = Session()