summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2017-12-01 17:59:53 -0800
committerJon Dufresne <jon.dufresne@gmail.com>2017-12-01 18:35:30 -0800
commitfcc083dc123946039fdfc88c55bbd4902dadd52a (patch)
treee7bc96626076c6b00f560ce139e9a23a0a04650f /tests
parenta51160317c680662c52e4a1a6b4d11beae37f205 (diff)
downloadpsycopg2-fcc083dc123946039fdfc88c55bbd4902dadd52a.tar.gz
Always import the system unittest
There is no need to import testutils.unittest instead of simply unittest. They are simple aliases. Use system unittest to be more regular, consistent as well as idiomatic with the wider Python community.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/__init__.py2
-rwxr-xr-xtests/test_async.py3
-rwxr-xr-xtests/test_async_keyword.py3
-rwxr-xr-xtests/test_cancel.py3
-rwxr-xr-xtests/test_copy.py3
-rwxr-xr-xtests/test_cursor.py3
-rwxr-xr-xtests/test_dates.py3
-rwxr-xr-xtests/test_errcodes.py3
-rwxr-xr-xtests/test_extras_dictcursor.py3
-rwxr-xr-xtests/test_fast_executemany.py2
-rwxr-xr-xtests/test_ipaddress.py2
-rwxr-xr-xtests/test_lobject.py3
-rwxr-xr-xtests/test_module.py3
-rwxr-xr-xtests/test_notify.py2
-rwxr-xr-xtests/test_psycopg2_dbapi20.py3
-rwxr-xr-xtests/test_quote.py3
-rwxr-xr-xtests/test_replication.py3
-rwxr-xr-xtests/test_sql.py3
-rwxr-xr-xtests/test_transaction.py3
-rwxr-xr-xtests/test_types_basic.py3
-rwxr-xr-xtests/test_types_extras.py3
-rwxr-xr-xtests/test_with.py3
22 files changed, 40 insertions, 22 deletions
diff --git a/tests/__init__.py b/tests/__init__.py
index 6cb6c7b..fa7e393 100755
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -29,7 +29,7 @@ warnings.simplefilter('error') # noqa
import sys
from testconfig import dsn
-from testutils import unittest
+import unittest
import test_async
import test_bugX000
diff --git a/tests/test_async.py b/tests/test_async.py
index 4eb5e6a..2c4bfa3 100755
--- a/tests/test_async.py
+++ b/tests/test_async.py
@@ -23,7 +23,8 @@
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
# License for more details.
-from testutils import unittest, skip_before_postgres, slow
+import unittest
+from testutils import skip_before_postgres, slow
import psycopg2
from psycopg2 import extensions as ext
diff --git a/tests/test_async_keyword.py b/tests/test_async_keyword.py
index ddf4326..e08c275 100755
--- a/tests/test_async_keyword.py
+++ b/tests/test_async_keyword.py
@@ -29,7 +29,8 @@ import psycopg2
from psycopg2 import extras
from testconfig import dsn
-from testutils import ConnectingTestCase, unittest, skip_before_postgres, slow
+import unittest
+from testutils import ConnectingTestCase, skip_before_postgres, slow
from test_replication import ReplicationTestCase, skip_repl_if_green
from psycopg2.extras import LogicalReplicationConnection, StopReplication
diff --git a/tests/test_cancel.py b/tests/test_cancel.py
index 529c4ba..7888bbf 100755
--- a/tests/test_cancel.py
+++ b/tests/test_cancel.py
@@ -31,7 +31,8 @@ import psycopg2.extensions
from psycopg2 import extras
from testconfig import dsn
-from testutils import unittest, ConnectingTestCase, skip_before_postgres, slow
+import unittest
+from testutils import ConnectingTestCase, skip_before_postgres, slow
class CancelTests(ConnectingTestCase):
diff --git a/tests/test_copy.py b/tests/test_copy.py
index c5e7913..d52b802 100755
--- a/tests/test_copy.py
+++ b/tests/test_copy.py
@@ -24,7 +24,8 @@
import sys
import string
-from testutils import (unittest, ConnectingTestCase, decorate_all_tests,
+import unittest
+from testutils import (ConnectingTestCase, decorate_all_tests,
skip_before_postgres, slow)
from cStringIO import StringIO
from itertools import cycle, izip
diff --git a/tests/test_cursor.py b/tests/test_cursor.py
index c5ce70f..1676d0f 100755
--- a/tests/test_cursor.py
+++ b/tests/test_cursor.py
@@ -26,7 +26,8 @@ import time
import pickle
import psycopg2
import psycopg2.extensions
-from testutils import (unittest, ConnectingTestCase, skip_before_postgres,
+import unittest
+from testutils import (ConnectingTestCase, skip_before_postgres,
skip_if_no_getrefcount, slow, skip_if_no_superuser,
skip_if_windows)
diff --git a/tests/test_dates.py b/tests/test_dates.py
index 9ce74d8..ccfdc20 100755
--- a/tests/test_dates.py
+++ b/tests/test_dates.py
@@ -25,7 +25,8 @@
import math
import psycopg2
from psycopg2.tz import FixedOffsetTimezone, ZERO
-from testutils import unittest, ConnectingTestCase, skip_before_postgres
+import unittest
+from testutils import ConnectingTestCase, skip_before_postgres
def total_seconds(d):
diff --git a/tests/test_errcodes.py b/tests/test_errcodes.py
index d651b22..0fdf8e5 100755
--- a/tests/test_errcodes.py
+++ b/tests/test_errcodes.py
@@ -22,7 +22,8 @@
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
# License for more details.
-from testutils import unittest, ConnectingTestCase, slow
+import unittest
+from testutils import ConnectingTestCase, slow
try:
reload
diff --git a/tests/test_extras_dictcursor.py b/tests/test_extras_dictcursor.py
index 2c867d3..06d8af6 100755
--- a/tests/test_extras_dictcursor.py
+++ b/tests/test_extras_dictcursor.py
@@ -18,7 +18,8 @@ import time
from datetime import timedelta
import psycopg2
import psycopg2.extras
-from testutils import unittest, ConnectingTestCase, skip_before_postgres
+import unittest
+from testutils import ConnectingTestCase, skip_before_postgres
class ExtrasDictCursorTests(ConnectingTestCase):
diff --git a/tests/test_fast_executemany.py b/tests/test_fast_executemany.py
index ad7a5b1..32b3454 100755
--- a/tests/test_fast_executemany.py
+++ b/tests/test_fast_executemany.py
@@ -17,7 +17,7 @@
from datetime import date
import testutils
-from testutils import unittest
+import unittest
import psycopg2
import psycopg2.extras
diff --git a/tests/test_ipaddress.py b/tests/test_ipaddress.py
index bfeaae4..ea193bf 100755
--- a/tests/test_ipaddress.py
+++ b/tests/test_ipaddress.py
@@ -20,7 +20,7 @@ import sys
from functools import wraps
import testutils
-from testutils import unittest
+import unittest
import psycopg2
import psycopg2.extras
diff --git a/tests/test_lobject.py b/tests/test_lobject.py
index 8eafabc..7e91fe7 100755
--- a/tests/test_lobject.py
+++ b/tests/test_lobject.py
@@ -29,7 +29,8 @@ from functools import wraps
import psycopg2
import psycopg2.extensions
-from testutils import (unittest, decorate_all_tests, skip_if_tpc_disabled,
+import unittest
+from testutils import (decorate_all_tests, skip_if_tpc_disabled,
ConnectingTestCase, skip_if_green, slow)
diff --git a/tests/test_module.py b/tests/test_module.py
index 4a4941c..13391d1 100755
--- a/tests/test_module.py
+++ b/tests/test_module.py
@@ -26,7 +26,8 @@ import os
import sys
from subprocess import Popen
-from testutils import (unittest, skip_before_postgres,
+import unittest
+from testutils import (skip_before_postgres,
ConnectingTestCase, skip_copy_if_green, script_to_py3, slow)
import psycopg2
diff --git a/tests/test_notify.py b/tests/test_notify.py
index 0e74e1d..fabc3b6 100755
--- a/tests/test_notify.py
+++ b/tests/test_notify.py
@@ -22,7 +22,7 @@
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
# License for more details.
-from testutils import unittest
+import unittest
import psycopg2
from psycopg2 import extensions
diff --git a/tests/test_psycopg2_dbapi20.py b/tests/test_psycopg2_dbapi20.py
index c780d50..3bcedc4 100755
--- a/tests/test_psycopg2_dbapi20.py
+++ b/tests/test_psycopg2_dbapi20.py
@@ -25,7 +25,8 @@
import dbapi20
import dbapi20_tpc
from testutils import skip_if_tpc_disabled
-from testutils import unittest, decorate_all_tests
+import unittest
+from testutils import decorate_all_tests
import psycopg2
from testconfig import dsn
diff --git a/tests/test_quote.py b/tests/test_quote.py
index 1ced845..0f60dd9 100755
--- a/tests/test_quote.py
+++ b/tests/test_quote.py
@@ -24,7 +24,8 @@
import sys
import testutils
-from testutils import unittest, ConnectingTestCase
+import unittest
+from testutils import ConnectingTestCase
import psycopg2
import psycopg2.extensions
diff --git a/tests/test_replication.py b/tests/test_replication.py
index d03c656..444dd11 100755
--- a/tests/test_replication.py
+++ b/tests/test_replication.py
@@ -27,7 +27,8 @@ from psycopg2.extras import (
PhysicalReplicationConnection, LogicalReplicationConnection, StopReplication)
import testconfig
-from testutils import unittest, ConnectingTestCase
+import unittest
+from testutils import ConnectingTestCase
from testutils import skip_before_postgres, skip_if_green
skip_repl_if_green = skip_if_green("replication not supported in green mode")
diff --git a/tests/test_sql.py b/tests/test_sql.py
index 2e12ba6..bf2f96f 100755
--- a/tests/test_sql.py
+++ b/tests/test_sql.py
@@ -24,7 +24,8 @@
import datetime as dt
from cStringIO import StringIO
-from testutils import (unittest, ConnectingTestCase,
+import unittest
+from testutils import (ConnectingTestCase,
skip_before_postgres, skip_before_python, skip_copy_if_green)
import psycopg2
diff --git a/tests/test_transaction.py b/tests/test_transaction.py
index dd487c0..26704d8 100755
--- a/tests/test_transaction.py
+++ b/tests/test_transaction.py
@@ -23,7 +23,8 @@
# License for more details.
import threading
-from testutils import unittest, ConnectingTestCase, skip_before_postgres, slow
+import unittest
+from testutils import ConnectingTestCase, skip_before_postgres, slow
import psycopg2
from psycopg2.extensions import (
diff --git a/tests/test_types_basic.py b/tests/test_types_basic.py
index b0af6da..cd1a4f6 100755
--- a/tests/test_types_basic.py
+++ b/tests/test_types_basic.py
@@ -27,7 +27,8 @@ import decimal
import sys
from functools import wraps
import testutils
-from testutils import unittest, ConnectingTestCase, decorate_all_tests
+import unittest
+from testutils import ConnectingTestCase, decorate_all_tests
import psycopg2
diff --git a/tests/test_types_extras.py b/tests/test_types_extras.py
index f50b1b5..8526814 100755
--- a/tests/test_types_extras.py
+++ b/tests/test_types_extras.py
@@ -22,7 +22,8 @@ from datetime import date, datetime
from functools import wraps
from pickle import dumps, loads
-from testutils import (unittest, skip_if_no_uuid, skip_before_postgres,
+import unittest
+from testutils import (skip_if_no_uuid, skip_before_postgres,
ConnectingTestCase, decorate_all_tests, py3_raises_typeerror, slow)
import psycopg2
diff --git a/tests/test_with.py b/tests/test_with.py
index 53dfa46..83612de 100755
--- a/tests/test_with.py
+++ b/tests/test_with.py
@@ -25,7 +25,8 @@
import psycopg2
import psycopg2.extensions as ext
-from testutils import unittest, ConnectingTestCase
+import unittest
+from testutils import ConnectingTestCase
class WithTestCase(ConnectingTestCase):