Skip to content

Commit ae50558

Browse files
authored
Add pytest tmp_path (#706)
1 parent 3056f40 commit ae50558

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/test_encoders.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ def test_bad_input(self):
5656
encoder.to_tensor(format=bad_format)
5757

5858
@pytest.mark.parametrize("method", ("to_file", "to_tensor"))
59-
def test_bad_input_parametrized(self, method):
59+
def test_bad_input_parametrized(self, method, tmp_path):
6060
valid_params = (
61-
dict(dest="output.mp3") if method == "to_file" else dict(format="mp3")
61+
dict(dest=str(tmp_path / "output.mp3"))
62+
if method == "to_file"
63+
else dict(format="mp3")
6264
)
6365

6466
decoder = AudioEncoder(self.decode(NASA_AUDIO_MP3), sample_rate=10)

0 commit comments

Comments
 (0)