Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
make tests slightly faster on PyPy
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowJonathan committed Feb 2, 2021
1 parent aa2a3a4 commit 3985c24
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import hmac
import inspect
import logging
import platform
import time
from typing import Callable, Dict, Iterable, Optional, Tuple, Type, TypeVar, Union

Expand Down Expand Up @@ -126,7 +127,8 @@ def tearDown(orig):
ret = orig()
# force a GC to workaround problems with deferreds leaking logcontexts when
# they are GCed (see the logcontext docs)
gc.collect()
if platform.python_implementation() != "PyPy":
gc.collect()
set_current_context(SENTINEL_CONTEXT)

return ret
Expand Down

0 comments on commit 3985c24

Please sign in to comment.