-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI: avoid file leaks in sas_xport tests #35693
Conversation
pandas/tests/io/sas/test_xport.py
Outdated
@@ -127,7 +131,8 @@ def test2_binary(self): | |||
data_csv = pd.read_csv(self.file02.replace(".xpt", ".csv")) | |||
numeric_as_float(data_csv) | |||
|
|||
data = read_sas(self.file02b, format="xport") | |||
with open(self.file02, "rb") as fd: | |||
data = read_sas(fd, format="xport") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this actually leaking?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC ATM we're passing an open file and the read_sas call closes it incorrectly, so its an anti-leak
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't make sense; there is a bug in the xport reader; paper it over here is not a great soln.
thanks! |
Introduces a contextmanager version of td.check_file_leaks so we can do more targeted versions of those checks for debugging