From 108e97baad2d56ce72c870fa98b247471ea2cc30 Mon Sep 17 00:00:00 2001 From: "A. Jesse Jiryu Davis" Date: Wed, 10 Dec 2014 14:11:33 -0500 Subject: [PATCH] Unused imports in tests. --- test/high_availability/test_ha.py | 5 +---- test/test_collection.py | 6 ++---- test/test_database.py | 16 +++++++--------- test/test_replica_set_client.py | 3 +-- test/test_topology.py | 1 - tools/benchmark.py | 1 - 6 files changed, 11 insertions(+), 21 deletions(-) diff --git a/test/high_availability/test_ha.py b/test/high_availability/test_ha.py index adcf5f521..cf16805f2 100644 --- a/test/high_availability/test_ha.py +++ b/test/high_availability/test_ha.py @@ -23,7 +23,6 @@ import itertools import time import ha_tools - from pymongo import common from pymongo.common import partition_node from pymongo.errors import (AutoReconnect, @@ -33,14 +32,12 @@ from pymongo.errors import (AutoReconnect, from pymongo.mongo_client import MongoClient from pymongo.read_preferences import ReadPreference from pymongo.server_description import ServerDescription -from pymongo.server_selectors import (secondary_server_selector, - writable_server_selector) - from test import SkipTest, unittest, utils, client_knobs from test.utils import one, wait_until, connected from test.version import Version + # To make the code terser, copy modes into module scope PRIMARY = ReadPreference.PRIMARY PRIMARY_PREFERRED = ReadPreference.PRIMARY_PREFERRED diff --git a/test/test_collection.py b/test/test_collection.py index 7e310afc1..cb42b6319 100644 --- a/test/test_collection.py +++ b/test/test_collection.py @@ -21,7 +21,6 @@ import re import sys import threading import time -import uuid import warnings sys.path[0:0] = [""] @@ -31,10 +30,9 @@ from bson.code import Code from bson.dbref import DBRef from bson.objectid import ObjectId from bson.py3compat import u, itervalues -from bson.son import SON, RE_TYPE +from bson.son import SON from pymongo import (ASCENDING, DESCENDING, GEO2D, GEOHAYSTACK, GEOSPHERE, HASHED, TEXT) -from pymongo import message as message_module from pymongo import MongoClient from pymongo.collection import Collection from pymongo.command_cursor import CommandCursor @@ -49,7 +47,7 @@ from pymongo.errors import (DocumentTooLarge, WTimeoutError) from test.test_client import IntegrationTest from test.utils import (is_mongos, joinall, enable_text_search, get_pool, - oid_generated_on_client, one, ignore_deprecations, + oid_generated_on_client, ignore_deprecations, rs_or_single_client, wait_until) from test import client_context, host, port, qcheck, unittest diff --git a/test/test_database.py b/test/test_database.py index 46ca9bcf8..2c2e9c39f 100644 --- a/test/test_database.py +++ b/test/test_database.py @@ -27,7 +27,7 @@ from bson.regex import Regex from bson.dbref import DBRef from bson.objectid import ObjectId from bson.py3compat import u, string_type, text_type, PY3 -from bson.son import SON, RE_TYPE +from bson.son import SON from pymongo import (MongoClient, ALL, auth, @@ -51,14 +51,12 @@ from test import (client_context, unittest, host, port, - IntegrationTest, - db_user) -from test.utils import ( - ignore_deprecations, - remove_all_users, - rs_or_single_client_noauth, - rs_or_single_client, - server_started_with_auth) + IntegrationTest) +from test.utils import (ignore_deprecations, + remove_all_users, + rs_or_single_client_noauth, + rs_or_single_client, + server_started_with_auth) if PY3: diff --git a/test/test_replica_set_client.py b/test/test_replica_set_client.py index e6e0df6f6..a6521a7fe 100644 --- a/test/test_replica_set_client.py +++ b/test/test_replica_set_client.py @@ -43,8 +43,7 @@ from test import (client_context, db_user, MockClientTest) from test.pymongo_mocks import MockClient -from test.utils import (assertRaisesExactly, - connected, +from test.utils import (connected, delay, ignore_deprecations, one, diff --git a/test/test_topology.py b/test/test_topology.py index 3e74f6475..1e9a778a6 100644 --- a/test/test_topology.py +++ b/test/test_topology.py @@ -32,7 +32,6 @@ from pymongo.errors import (ConfigurationError, from pymongo.ismaster import IsMaster from pymongo.monitor import Monitor from pymongo.pool import PoolOptions -from pymongo.read_preferences import MovingAverage from pymongo.server_description import ServerDescription from pymongo.server_selectors import (any_server_selector, writable_server_selector) diff --git a/tools/benchmark.py b/tools/benchmark.py index a7daa2c64..e954ac3e7 100644 --- a/tools/benchmark.py +++ b/tools/benchmark.py @@ -19,7 +19,6 @@ import sys sys.path[0:0] = [""] import datetime -import cProfile from pymongo import mongo_client from pymongo import ASCENDING