python - Using Mocks inside Doctests? -


i using doctests. wondering correct way doctest function performs external action (e.g. sends email, connects server, etc)? using mock seems answer muddy doc string of function.

for example:

class sshconnection(baseconnection):     """provides basic ssh functions.      >>> host = '127.0.0.1'     >>> port = 22     >>> username = 'user'     >>> password = 'password'     >>> ssh = sshconnection(host, username, password, port)     >>> ssh.execute('uname -a')     """ ... 


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -