MOTOR-397 Fix import errors in synchro test

This commit is contained in:
Shane Harvey 2019-09-26 14:53:01 -07:00
parent 343926df85
commit 5c2da3887d
3 changed files with 17 additions and 4 deletions

View File

@ -1602,7 +1602,7 @@ class AgnosticChangeStream(AgnosticBase):
The next change document or ``None`` when no document is available
after running a single getMore or when the cursor is closed.
.. versionaddedd:: 2.1
.. versionadded:: 2.1
"""
loop = self.get_io_loop()
return self._framework.run_on_executor(loop, self._try_next)

View File

@ -54,9 +54,12 @@ from pymongo.client_session import TransactionOptions
from pymongo.collation import *
from pymongo.common import *
from pymongo.common import _UUID_REPRESENTATIONS, _MAX_END_SESSIONS
from pymongo.compression_support import _HAVE_SNAPPY, _HAVE_ZLIB
from pymongo.compression_support import _HAVE_SNAPPY, _HAVE_ZLIB, _HAVE_ZSTD
from pymongo.cursor import *
from pymongo.cursor import _QUERY_OPTIONS
from pymongo.encryption import *
from pymongo.encryption_options import *
from pymongo.encryption_options import _HAVE_PYMONGOCRYPT
from pymongo.errors import *
from pymongo.message import (_COMMAND_OVERHEAD,
_CursorAddress,
@ -68,7 +71,7 @@ from pymongo.monitoring import _LISTENERS, _Listeners, _SENSITIVE_COMMANDS
from pymongo.monotonic import time
from pymongo.operations import *
from pymongo.pool import *
from pymongo.pool import _METADATA
from pymongo.pool import _METADATA, _PoolClosedError
from pymongo.periodic_executor import *
from pymongo.periodic_executor import _EXECUTORS
from pymongo.read_concern import *
@ -85,7 +88,7 @@ from pymongo.son_manipulator import *
from pymongo.topology import *
from pymongo.topology_description import *
from pymongo.uri_parser import *
from pymongo.uri_parser import _partition, _rpartition, _HAVE_DNSPYTHON
from pymongo.uri_parser import _HAVE_DNSPYTHON
from pymongo.write_concern import *
from pymongo import auth
from pymongo.auth import *

View File

@ -237,17 +237,27 @@ class SynchroNosePlugin(Plugin):
# them as unittests.
if fn.__name__ in ('test_cases',
'create_test',
'create_tests',
'create_connection_string_test',
'create_document_test',
'create_selection_tests',
):
return False
def wantClass(self, cls):
# PyMongo's test generator classes run at import time; tell Nose not
# to run them as unittests.
if cls.__name__ in ('TestCreator',):
return False
def wantMethod(self, method):
# Run standard Nose checks on name, like "does it start with test_"?
if not self.selector.matches(method.__name__):
return False
if method.__name__ in ('run_test_ops',):
return False
for excluded_name in excluded_tests:
if PY3:
classname = method.__self__.__class__.__name__