From 47ce2347b05bb13af6c6430c24341e5892b22ffa Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 14 Nov 2017 20:28:13 +0300 Subject: [PATCH] Create test that fails when actual cleanup caused --- spacy/tests/regression/test_issue1506.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spacy/tests/regression/test_issue1506.py b/spacy/tests/regression/test_issue1506.py index f3ebbe04b..2abde25bf 100644 --- a/spacy/tests/regression/test_issue1506.py +++ b/spacy/tests/regression/test_issue1506.py @@ -35,6 +35,11 @@ def test_issue1506(): del anchor gc.collect() + # We should run cleanup more than one time to actually cleanup data. + # In first run — clean up only mark strings as «not hitted». + if i == 20000 or i == 30000: + gc.collect() + for t in d: str(t.lemma_)