diff --git a/pandas/tests/io/test_common.py b/pandas/tests/io/test_common.py index 5b3b5602c95bc..1945012f93b42 100644 --- a/pandas/tests/io/test_common.py +++ b/pandas/tests/io/test_common.py @@ -361,7 +361,7 @@ def test_write_fspath_all(self, writer_name, writer_kwargs, module): writer(string, **writer_kwargs) writer(mypath, **writer_kwargs) with open(string, "rb") as f_str, open(fspath, "rb") as f_path: - if writer == "to_excel": + if writer_name == "to_excel": # binary representation of excel contains time creation # data that causes flaky CI failures result = pd.read_excel(f_str, **writer_kwargs)