File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ flake8==3.9.2
5
5
flaky==3.7.0
6
6
mypy==0.902
7
7
objgraph==3.5.0
8
- pandas==1.2.4
9
8
Pillow==8.2.0
10
9
pixelmatch==0.2.3
11
10
pre-commit==2.13.0
Original file line number Diff line number Diff line change 13
13
# limitations under the License.
14
14
15
15
import gc
16
+ from collections import defaultdict
16
17
17
18
import objgraph
18
- import pandas as pd
19
19
import pytest
20
20
21
21
from playwright .async_api import async_playwright
@@ -42,11 +42,13 @@ async def test_memory_objects() -> None:
42
42
43
43
gc .collect ()
44
44
45
- df_dicts = pd .DataFrame ()
46
- df_dicts ["dicts" ] = objgraph .by_type ("dict" )
47
- df_dicts ["pw_types" ] = df_dicts ["dicts" ].apply (lambda x : x .get ("_type" ))
45
+ pw_objects = defaultdict (int )
46
+ for o in objgraph .by_type ("dict" ):
47
+ name = o .get ("_type" )
48
+ if not name :
49
+ continue
50
+ pw_objects [name ] += 1
48
51
49
- head = df_dicts ["pw_types" ].value_counts ().head (20 )
50
- assert "Dialog" not in head .items ()
51
- assert "Request" not in head .items ()
52
- assert "Route" not in head .items ()
52
+ assert "Dialog" not in pw_objects
53
+ assert "Request" not in pw_objects
54
+ assert "Route" not in pw_objects
You can’t perform that action at this time.
0 commit comments