| 38 | ) |
| 39 | class TestFork(IntegrationTest): |
| 40 | def test_lock_client(self): |
| 41 | # Forks the client with some items locked. |
| 42 | # Parent => All locks should be as before the fork. |
| 43 | # Child => All locks should be reset. |
| 44 | with self.client._lock: |
| 45 | |
| 46 | def target(): |
| 47 | with warnings.catch_warnings(): |
| 48 | warnings.simplefilter("ignore") |
| 49 | self.client.admin.command("ping") |
| 50 | |
| 51 | with self.fork(target): |
| 52 | pass |
| 53 | self.client.admin.command("ping") |
| 54 | |
| 55 | def test_lock_object_id(self): |
| 56 | # Forks the client with ObjectId's _inc_lock locked. |