1
1
import os
2
2
from pathlib import Path
3
+ import platform
3
4
import subprocess
4
5
import sys
5
6
import weakref
@@ -86,6 +87,11 @@ def test_null_movie_writer(anim):
86
87
87
88
@pytest .mark .parametrize ('anim' , [dict (klass = dict )], indirect = ['anim' ])
88
89
def test_animation_delete (anim ):
90
+ if platform .python_implementation () == 'PyPy' :
91
+ # Something in the test setup fixture lingers around into the test and
92
+ # breaks pytest.warns on PyPy. This garbage collection fixes it.
93
+ # https://foss.heptapod.net/pypy/pypy/-/issues/3536
94
+ np .testing .break_cycles ()
89
95
anim = animation .FuncAnimation (** anim )
90
96
with pytest .warns (Warning , match = 'Animation was deleted' ):
91
97
del anim
@@ -200,6 +206,11 @@ def test_save_animation_smoketest(tmpdir, writer, frame_format, output, anim):
200
206
])
201
207
@pytest .mark .parametrize ('anim' , [dict (klass = dict )], indirect = ['anim' ])
202
208
def test_animation_repr_html (writer , html , want , anim ):
209
+ if platform .python_implementation () == 'PyPy' :
210
+ # Something in the test setup fixture lingers around into the test and
211
+ # breaks pytest.warns on PyPy. This garbage collection fixes it.
212
+ # https://foss.heptapod.net/pypy/pypy/-/issues/3536
213
+ np .testing .break_cycles ()
203
214
if (writer == 'imagemagick' and html == 'html5'
204
215
# ImageMagick delegates to ffmpeg for this format.
205
216
and not animation .FFMpegWriter .isAvailable ()):
0 commit comments