httpx icon indicating copy to clipboard operation
httpx copied to clipboard

tests: fix win32

Open trim21 opened this issue 10 months ago • 2 comments

Summary

There are several test cases broken on windows.

Checklist

  • [X] I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • [ ] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • [ ] I've updated the documentation accordingly.

trim21 avatar Apr 17 '24 13:04 trim21

coverage failed because this:

https://github.com/encode/httpx/blob/fa6dac8383541669f42086d4f07c71b0f8d6a279/httpx/_multipart.py#L127-L134

io.StringIO is a subclass of io.TextIOBase

trim21 avatar May 07 '24 23:05 trim21

I just use pytest's tmp_path to create a real file on disk. pytest will clean it up after test.

trim21 avatar May 07 '24 23:05 trim21