summaryrefslogtreecommitdiff
path: root/tests/test_rust_utils.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2022-09-11 18:45:22 -0400
committerGitHub <noreply@github.com>2022-09-11 17:45:22 -0500
commit30114c6ea9b8fca98d88bfe90aa2f39b6182820d (patch)
treefd97162b5810765a72b81e9fe36a486cdfc39c84 /tests/test_rust_utils.py
parentd480268f294701a4897d0c82a468bc8f16c5dd10 (diff)
downloadcryptography-30114c6ea9b8fca98d88bfe90aa2f39b6182820d.tar.gz
Remove destroy from FixedPool (#7602)
turns out we don't need it
Diffstat (limited to 'tests/test_rust_utils.py')
-rw-r--r--tests/test_rust_utils.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/tests/test_rust_utils.py b/tests/test_rust_utils.py
index 99ddfb01a..1ee68541e 100644
--- a/tests/test_rust_utils.py
+++ b/tests/test_rust_utils.py
@@ -19,10 +19,7 @@ class TestFixedPool:
events.append(("create", c))
return c
- def destroy(c):
- events.append(("destroy", c))
-
- pool = FixedPool(create, destroy)
+ pool = FixedPool(create)
assert events == [("create", 1)]
with pool.acquire() as c:
assert c == 1
@@ -32,9 +29,9 @@ class TestFixedPool:
assert c == 2
assert events == [("create", 1), ("create", 2)]
- assert events == [("create", 1), ("create", 2), ("destroy", 2)]
+ assert events == [("create", 1), ("create", 2)]
- assert events == [("create", 1), ("create", 2), ("destroy", 2)]
+ assert events == [("create", 1), ("create", 2)]
del pool
gc.collect()
@@ -44,18 +41,13 @@ class TestFixedPool:
assert events == [
("create", 1),
("create", 2),
- ("destroy", 2),
- ("destroy", 1),
]
def test_thread_stress(self):
def create():
return None
- def destroy(c):
- pass
-
- pool = FixedPool(create, destroy)
+ pool = FixedPool(create)
def thread_fn():
with pool.acquire():