New submission from Damien Nadé <[email protected]>:
Let's say I have a function that opens 2 files and compare them. mock_open
would not allow me to test this case, as it would return the same data for both
files (through its read_data argument).
I want to be able to do this in a mocked-open context:
```
with open("file1") as file1:
assert file1.read() == "data1"
with open("file2") as file2:
assert file2.read() == "data2"
```
----------
components: Library (Lib)
messages: 348386
nosy: Anvil
priority: normal
severity: normal
status: open
title: Make mock_open return per-file content
type: enhancement
versions: Python 3.7, Python 3.8, Python 3.9
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue37669>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com