The Python Oracle

Python testing: using a fake file with mock & io.StringIO

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Melt

--

Chapters
00:00 Question
01:41 Accepted answer (Score 11)
03:16 Answer 2 (Score 3)
03:42 Thank you

--

Full question
https://stackoverflow.com/questions/4040...

Accepted answer links:
[mock_open()]: https://docs.python.org/3/library/unitte...

Answer 2 links:
[pytest-mock]: https://pypi.org/project/pytest-mock/
[here]: https://github.com/pytest-dev/pytest-moc...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #unittesting #mocking #pythonmock

#avk47