Skip to content

Commit

Permalink
use tmp_path fixture in parser test
Browse files Browse the repository at this point in the history
  • Loading branch information
siddhantgoel committed Oct 28, 2020
1 parent a265968 commit 6a43538
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ def test_target_exceeds_max_size():
assert target._finished


def test_file_target_exceeds_max_size():
def test_file_target_exceeds_max_size(tmp_path):
data = b'''\
--1234
Content-Disposition: form-data; name="files"; filename="ab.txt"
Expand All @@ -809,7 +809,7 @@ def test_file_target_exceeds_max_size():
b'\n', b'\r\n'
)

target = FileTarget('/tmp/file.txt', validator=MaxSizeValidator(1))
target = FileTarget(tmp_path / 'file.txt', validator=MaxSizeValidator(1))

parser = StreamingFormDataParser(
headers={'Content-Type': 'multipart/form-data; boundary=1234'}
Expand Down

0 comments on commit 6a43538

Please sign in to comment.