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 29 30 31 32 33 34 35 36 37 38 39 40
|
From: Maximilian Engelhardt <maxi@daemonizer.de>
Date: Wed, 12 Mar 2025 19:54:02 +0100
Subject: Fix tests for python 3.13
unittest.makeSuite() was removed in python 3.13
This is a partly backport of upstream pull request #83.
Description: Fix tests for python 3.13
Bug: https://github.com/zopefoundation/zope.sqlalchemy/pull/83
Origin: backport
Author: Michael Howitz <icemac@gmx.net>
Last-Update: 2025-03-10
---
src/zope/sqlalchemy/tests.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/zope/sqlalchemy/tests.py b/src/zope/sqlalchemy/tests.py
index 5083924..ea98801 100644
--- a/src/zope/sqlalchemy/tests.py
+++ b/src/zope/sqlalchemy/tests.py
@@ -875,14 +875,14 @@ def tearDownReadMe(test):
def test_suite():
import doctest
from unittest import TestSuite
- from unittest import makeSuite
+ from unittest import defaultTestLoader
optionflags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS
suite = TestSuite()
- suite.addTest(makeSuite(ZopeSQLAlchemyTests))
- suite.addTest(makeSuite(MultipleEngineTests))
+ suite.addTest(defaultTestLoader.loadTestsFromTestCase(ZopeSQLAlchemyTests))
+ suite.addTest(defaultTestLoader.loadTestsFromTestCase(MultipleEngineTests))
if TEST_DSN.startswith("postgres") or TEST_DSN.startswith("oracle"):
- suite.addTest(makeSuite(RetryTests))
+ suite.addTest(defaultTestLoader.loadTestsFromTestCase(RetryTests))
# examples in docs are only correct for SQLAlchemy >=1.4
if parse_version(sqlalchemy_version) >= parse_version('1.4.0'):
|