Commit Graph

45 Commits

Author SHA1 Message Date
Bernie Hackett
f282babff0 PYTHON-926 - ReadPreference.NEAREST shouldn't pick arbiters. 2015-05-07 14:50:38 -07:00
Bernie Hackett
4026787edf Fix docstring. 2015-04-20 15:04:54 -07:00
Bernie Hackett
bc5e7d6ac9 PYTHON-905 - Fix $readPreference with query modifiers. 2015-04-20 15:02:17 -07:00
Bernie Hackett
aec685b374 Fix up copyright dates. 2015-03-25 11:55:02 -07:00
aherlihy
70c06d11a9 PYTHON-813 Removed client_knobs where no longer needed 2015-03-11 13:03:59 -07:00
aherlihy
fa1466179f PYTHON-813 Added support for serverSelectionTimeoutMS 2015-03-09 12:38:24 -07:00
A. Jesse Jiryu Davis
47a736da89 PYTHON-799 Avoid deadlock in Cursor destructor with PyPy.
Use a background thread to periodically close destroyed
cursors instead of killing them directly from Cursor.__del__.
2015-01-05 15:21:51 -05:00
A. Jesse Jiryu Davis
8a64f261fd Fix how unittests check for "enableTestCommands" server option. 2014-12-12 10:33:39 -05:00
A. Jesse Jiryu Davis
7adf3e6ec5 Tests detect when Mongo Orchestration has enabled test commands. 2014-12-09 15:56:14 -05:00
A. Jesse Jiryu Davis
0e222c4c4c Rename "set_name" to "replica_set_name".
Rename the attributes of IsMaster, ServerDescription, TopologyDescription, and
TopologySettings from "set_name" to "replica_set_name" for greater clarity.
2014-11-17 20:29:16 -05:00
A. Jesse Jiryu Davis
c2d4ca1a13 Fix require_test_commands decorator for unittests. 2014-11-13 15:48:45 -05:00
Luke Lovett
1799781669 Force all tests to run in alphabetical order by module name. 2014-11-04 00:10:26 +00:00
A. Jesse Jiryu Davis
0a246d2033 Standardize how tests construct MongoClients. 2014-10-30 19:36:59 -04:00
A. Jesse Jiryu Davis
c5eae2f99f Use replica set connection in tests wherever possible.
Most tests now inherit from IntegrationTest and use self.client for all MongoDB
operations. self.client is now a replica set connection if an RS is available,
otherwise a connection to a standalone.
2014-10-07 13:36:52 -04:00
A. Jesse Jiryu Davis
6641d04882 Unused imports. 2014-09-25 16:34:15 -04:00
A. Jesse Jiryu Davis
28d40f5745 Redundant implementation of partition_node(). 2014-09-25 16:34:15 -04:00
A. Jesse Jiryu Davis
3c9fd60fed PYTHON-525 Use MongoClient in replica set tests.
Connect the MongoClient to the replica set if one is running,
otherwise connect it to the standalone. Only continue to use
MongoReplicaSetClient when testing the specific behavior of
that deprecated class.

Also suppress some warnings when running tests, and better
determine whether to test IPv6.
2014-09-20 08:42:23 -04:00
Luke Lovett
aa7cf47731 PYTHON-758 Allow tests to use an existing user when running under auth. 2014-09-19 21:17:11 +00:00
A. Jesse Jiryu Davis
30c42979a1 Run tests even if prior run didn't clean up users.
If a previous test run created a user and didn't remove it (e.g. the test hung or a debugging session was terminated), the next test run will fail because of the narrowed localhost exception (SERVER-12621). Work around this by trying to log in as the test user, if that fails re-raise the original error.
2014-09-03 17:35:51 -04:00
A. Jesse Jiryu Davis
075fa1152b PYTHON-525 Tests determine quickly if a mongod is available.
Don't wait 5 seconds before giving up.
2014-09-03 17:35:43 -04:00
A. Jesse Jiryu Davis
2f9d24ade6 PYTHON-525 Reimplement MongoClient to use Cluster.
Replace MongoClient with an implementation that relies on Cluster and Server. The new MongoClient takes over MongoReplicaSetClient's responsibilities.

Authentication, secondary-pinning, and Mongos high-availability are broken and will be reimplemented in a future commit. RS tests are temporarily disabled.
2014-08-28 16:57:57 -04:00
Luke Lovett
75395df8db connection_string() helper should use given seed list even without auth enabled. 2014-07-07 21:53:18 +00:00
Luke Lovett
d7ec3a7704 PYTHON-715 Fix tests for MongoDB >= 2.7.1 when running with auth enabled. 2014-07-07 19:05:21 +00:00
Luke Lovett
4fa96c6c2e PYTHON-683 Separate unit tests and integration tests in the pymongo test suite.
Raise SkipTest in tests that require a connection to MongoDB when none is available.
2014-06-30 17:42:29 +00:00
Luke Lovett
26fb43cf78 PYTHON-681 Reuse MongoClient whenever possible in the tests 2014-05-21 20:41:18 +00:00
Luke Lovett
352a5f6231 Move test module-wide setup and teardown to a custom TestRunner class 2014-05-02 20:46:21 +00:00
Luke Lovett
95e3d2aa4a PYTHON-680 Add new test command to setup.py in order to avoid DeprecationWarning when raising SkipTest
The setuptools 'test' command uses the TestResult class from unittest,
even when we're using unittest2 for Python 2.6. Since the old unittest
TestResult class doesn't have an addSkip method, raising SkipTest
causes a DeprecationWarning instead of skipping a test.
2014-05-01 17:03:27 +00:00
Bernie Hackett
572c3fada5 Always raise warnings in tests. 2014-04-28 13:04:56 -07:00
behackett
86c0df0341 Use catch_warnings to test warnings. 2014-04-28 11:49:50 -07:00
Luke Lovett
141200083e PYTHON-680 Stop using nose in favor of pure unittest/unittest2 2014-04-25 22:57:33 +00:00
Luke Lovett
4d6d1e067b PYTHON-676 python 2/3 single-source for the test module 2014-04-23 18:37:02 +00:00
A. Jesse Jiryu Davis
2fa1750b07 Update copyright notices and company name. 2014-01-31 09:36:46 -05:00
Bernie Hackett
771c53a120 Always warn in tests regardless of python version. 2013-10-30 20:25:12 -07:00
A. Jesse Jiryu Davis
6c2e009f45 Fix MongoReplicaSetClient race conditions PYTHON-467
* RSState, Member, and MovingAverage are now immutable
* In refresh(), try up members before down ones
* A test_ha fixup (clear process-list after killing them in each test, so we don't re-kill previous tests' processes)
2013-05-01 14:14:20 -04:00
A. Jesse Jiryu Davis
8536acb4a0 Standardize tests' handling of DB_IP and DB_PORT, fix PYTHON-475 2013-02-19 15:09:28 -05:00
Ross Lawley
48046b2efd SSL certificate verification PYTHON-466 2013-02-19 15:45:57 +00:00
A. Jesse Jiryu Davis
c758efcb34 Rename test_connection -> test_client, test_replica_set_connection -> test_replica_set_client PYTHON-451 2013-02-11 21:33:55 -05:00
A. Jesse Jiryu Davis
d35bec12e5 Tests use MongoClient instead of Connection PYTHON-451 2013-02-11 20:57:17 -05:00
behackett
0ee7170cc2 It's 2012... 2012-04-19 12:40:38 -07:00
behackett
12592be1fe Python 3 unittest changes PYTHON-84. 2012-03-28 11:53:47 -07:00
behackett
3ac4264b92 Clean up all test dbs after test run. 2011-05-31 10:40:26 -07:00
behackett
2ed05bec70 PEP8 cleanups. 2011-04-06 14:57:17 -07:00
Mike Dirolf
021136e797 minor: test cleanup 2010-09-09 11:47:52 -04:00
Mike Dirolf
dff8e49928 add package level teardown to clean up after test runs 2010-01-21 13:38:36 -05:00
Mike Dirolf
3d57e76cd4 add test directory w/ some test data we can use 2009-01-06 15:44:36 -05:00