Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pandas/util/_test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def test_foo():
from __future__ import annotations

from contextlib import contextmanager
import gc
import locale
from typing import (
Callable,
Expand Down Expand Up @@ -272,12 +273,13 @@ def file_leak_context() -> Iterator[None]:
try:
yield
finally:
gc.collect()
flist2 = proc.open_files()
# on some builds open_files includes file position, which we _dont_
# expect to remain unchanged, so we need to compare excluding that
flist_ex = [(x.path, x.fd) for x in flist]
flist2_ex = [(x.path, x.fd) for x in flist2]
assert flist2_ex == flist_ex, (flist2, flist)
assert set(flist2_ex) <= set(flist_ex), (flist2, flist)

conns2 = proc.connections()
assert conns2 == conns, (conns2, conns)
Expand Down