We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 03d29ba commit 6e91a09Copy full SHA for 6e91a09
pandas/tests/io/test_common.py
@@ -151,18 +151,21 @@ def test_read_fspath_all(self, reader, module, path):
151
('to_stata', {}, 'os'),
152
])
153
def test_write_fspath_all(self, writer_name, writer_kwargs, module):
154
- with tm.ensure_clean('foo', return_filelike=False) as path:
+ p1 = tm.ensure_clean('string')
155
+ p2 = tm.ensure_clean('fspath')
156
+ df = pd.DataFrame({"A": [1, 2]})
157
+
158
+ with p1 as string, p2 as fspath:
159
pytest.importorskip(module)
- mypath = CustomFSPath(path)
- df = pd.DataFrame({"A": [1, 2]})
160
+ mypath = CustomFSPath(fspath)
161
writer = getattr(df, writer_name)
162
- writer(path, **writer_kwargs)
- with open(path, 'rb') as f:
163
+ writer(string, **writer_kwargs)
164
+ with open(string, 'rb') as f:
165
expected = f.read()
166
167
writer(mypath, **writer_kwargs)
168
+ with open(fspath, 'rb') as f:
169
result = f.read()
170
171
assert result == expected
0 commit comments