Skip to content

Commit 9b7d09d

Browse files
authored
TST: No longer produce test_stata.dta file after running test suite (#58381)
Use tmp_path fixture Co-authored-by: Abdulaziz Aloqeely <[email protected]>
1 parent bd9c09b commit 9b7d09d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pandas/tests/io/test_stata.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1962,7 +1962,7 @@ def test_writer_118_exceptions(self, temp_file):
19621962
"dtype_backend",
19631963
["numpy_nullable", pytest.param("pyarrow", marks=td.skip_if_no("pyarrow"))],
19641964
)
1965-
def test_read_write_ea_dtypes(self, dtype_backend, temp_file):
1965+
def test_read_write_ea_dtypes(self, dtype_backend, temp_file, tmp_path):
19661966
df = DataFrame(
19671967
{
19681968
"a": [1, 2, None],
@@ -1974,7 +1974,8 @@ def test_read_write_ea_dtypes(self, dtype_backend, temp_file):
19741974
index=pd.Index([0, 1, 2], name="index"),
19751975
)
19761976
df = df.convert_dtypes(dtype_backend=dtype_backend)
1977-
df.to_stata("test_stata.dta", version=118)
1977+
stata_path = tmp_path / "test_stata.dta"
1978+
df.to_stata(stata_path, version=118)
19781979

19791980
df.to_stata(temp_file)
19801981
written_and_read_again = self.read_dta(temp_file)

0 commit comments

Comments
 (0)