From: Daniele Varrazzo Date: Fri, 3 Jan 2025 20:24:35 +0000 (+0100) Subject: chore(tests): drop Python 2 check X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1eaf7e1e19582ba84a82db5c276d37cd53c29f9b;p=thirdparty%2Fpsycopg.git chore(tests): drop Python 2 check --- diff --git a/tests/dbapi20.py b/tests/dbapi20.py index ba9be6302..73a838fb3 100644 --- a/tests/dbapi20.py +++ b/tests/dbapi20.py @@ -21,7 +21,6 @@ __author__ = 'Stuart Bishop ' import unittest import time -import sys from typing import Any @@ -190,12 +189,8 @@ class DatabaseAPI20Test(unittest.TestCase): def test_Exceptions(self): # Make sure required exceptions exist, and are in the # defined hierarchy. - if sys.version[0] == '3': #under Python 3 StardardError no longer exists - self.assertTrue(issubclass(self.driver.Warning,Exception)) - self.assertTrue(issubclass(self.driver.Error,Exception)) - else: - self.assertTrue(issubclass(self.driver.Warning,StandardError)) # type: ignore[name-defined] - self.assertTrue(issubclass(self.driver.Error,StandardError)) # type: ignore[name-defined] + self.assertTrue(issubclass(self.driver.Warning,Exception)) + self.assertTrue(issubclass(self.driver.Error,Exception)) self.assertTrue( issubclass(self.driver.InterfaceError,self.driver.Error)