Skip to content

Commit

Permalink
Things DRMacIver does when he's bored of your shit
Browse files Browse the repository at this point in the history
pypy appears to be unable to realise that the thing that is using a large
amount of memory is worth triggering a GC for because it's not pure
python. Running a GC at each test setup helps keep this under control.
  • Loading branch information
DRMacIver committed Mar 18, 2015
1 parent ec50016 commit cc8c93f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@

import warnings
from tempfile import mkdtemp
import pytest

from hypothesis import Settings
from hypothesis.settings import set_hypothesis_home_dir
import gc

warnings.filterwarnings('error', category=UnicodeWarning)

Expand All @@ -32,3 +34,8 @@
resource.setrlimit(resource.RLIMIT_DATA, (MAX_MEMORY, MAX_MEMORY))
except ImportError:
pass


@pytest.fixture(scope="function", autouse=True)
def some_fixture():
gc.collect()

0 comments on commit cc8c93f

Please sign in to comment.