File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed
Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 1+ import pytest
2+ import pythonmonkey as pm
3+ import gc
4+
5+ # This is run at the end of each test function
6+ @pytest .fixture (scope = "function" , autouse = True )
7+ def teardown_function ():
8+ """
9+ Forcing garbage collection (twice) whenever a test function finishes,
10+ to locate GC-related errors
11+ """
12+ gc .collect (), pm .collect ()
13+ gc .collect (), pm .collect ()
Original file line number Diff line number Diff line change 77import asyncio
88import numpy , array , struct
99
10- # https://doc.pytest.org/en/latest/how-to/xunit_setup.html#method-and-function-level-setup-teardown
11- def teardown_function (function ):
12- """
13- Forcing garbage collection (twice) whenever a test function finishes,
14- to locate GC-related errors
15- """
16- gc .collect (), pm .collect ()
17- gc .collect (), pm .collect ()
18-
1910def test_passes ():
2011 assert True
2112
You can’t perform that action at this time.
0 commit comments