File: tests-Move-import-of-function-declarative_base.patch

package info (click to toggle)
sqlalchemy-utc 0.14.0-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 180 kB
  • sloc: python: 241; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 1,078 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: Sun, 26 May 2024 11:41:00 +0200
Subject: tests: Move import of function declarative_base()

The source for the function declarative_base() has been moved to
sqlalchemy.orm. The deprecation is thrown a while in version 1.4 of
SQLalchemy.

The declarative_base() function is now available as sqlalchemy.orm.declarative_base(). (deprecated since: 2.0) (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
Base = declarative_base()
---
 tests/test_sqltypes.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/test_sqltypes.py b/tests/test_sqltypes.py
index 980c5f3..2b34202 100644
--- a/tests/test_sqltypes.py
+++ b/tests/test_sqltypes.py
@@ -9,8 +9,7 @@ else:
 from pytest import mark, raises, fixture
 
 from sqlalchemy.exc import StatementError
-from sqlalchemy.ext.declarative import declarative_base
-from sqlalchemy.orm import sessionmaker
+from sqlalchemy.orm import declarative_base, sessionmaker
 from sqlalchemy.schema import Column
 
 from sqlalchemy_utc import UtcDateTime, utc