New submission from Terry J. Reedy:

When writing tests for config and configdialog, I blocked the user configs from 
hitting the filesystem by passing '' as the file name.  This disables the Save 
function.  To know that Save is called, a mock is needed.  To know what would 
have been written to disk, the mock could write to a StringIO.  Since there are 
4 files and 4 config parsers, there are 4 save functions.  I would mock each 
separately so it can be determined that the right one was called.  I plan to 
create a specialized version of idle_mock.Func with a simplified version of 
Save's body in the __call__ method.

----------
assignee: terry.reedy
components: IDLE
messages: 297854
nosy: terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE: Improve configuration tests with mock Save.
type: enhancement
versions: Python 3.6, Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30868>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to