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.
This commit is contained in:
Jon Dufresne 2017-12-01 17:59:53 -08:00
parent a51160317c
commit fcc083dc12
22 changed files with 40 additions and 22 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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):

View File

@ -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

View File

@ -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)

View File

@ -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):

View File

@ -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

View File

@ -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):

View File

@ -17,7 +17,7 @@
from datetime import date
import testutils
from testutils import unittest
import unittest
import psycopg2
import psycopg2.extras

View File

@ -20,7 +20,7 @@ import sys
from functools import wraps
import testutils
from testutils import unittest
import unittest
import psycopg2
import psycopg2.extras

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -24,7 +24,8 @@
import sys
import testutils
from testutils import unittest, ConnectingTestCase
import unittest
from testutils import ConnectingTestCase
import psycopg2
import psycopg2.extensions

View File

@ -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")

View File

@ -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

View File

@ -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 (

View File

@ -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

View File

@ -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

View File

@ -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):