()
| 362 | |
| 363 | |
| 364 | def test_SerializableLock(): |
| 365 | a = SerializableLock() |
| 366 | b = SerializableLock() |
| 367 | with a: |
| 368 | pass |
| 369 | |
| 370 | with a: |
| 371 | with b: |
| 372 | pass |
| 373 | |
| 374 | with a: |
| 375 | assert not a.acquire(False) |
| 376 | |
| 377 | a2 = pickle.loads(pickle.dumps(a)) |
| 378 | a3 = pickle.loads(pickle.dumps(a)) |
| 379 | a4 = pickle.loads(pickle.dumps(a2)) |
| 380 | |
| 381 | for x in [a, a2, a3, a4]: |
| 382 | for y in [a, a2, a3, a4]: |
| 383 | with x: |
| 384 | assert not y.acquire(False) |
| 385 | |
| 386 | b2 = pickle.loads(pickle.dumps(b)) |
| 387 | b3 = pickle.loads(pickle.dumps(b2)) |
| 388 | |
| 389 | for x in [a, a2, a3, a4]: |
| 390 | for y in [b, b2, b3]: |
| 391 | with x: |
| 392 | with y: |
| 393 | pass |
| 394 | with y: |
| 395 | with x: |
| 396 | pass |
| 397 | |
| 398 | |
| 399 | def test_SerializableLock_name_collision(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…