Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31694

Add if...else... switch to doctest?

Newsgroups comp.lang.python
Date 2012-10-18 17:08 -0700
Message-ID <c500a76c-3e6b-4dfc-97ca-8b24f0628620@googlegroups.com> (permalink)
Subject Add if...else... switch to doctest?
From David <zhushenli@gmail.com>

Show all headers | View raw


Hello, how to add if...else... switch to doctest?
E.g. function outputs different value when global_var change.

"""
if (global_var == True):
>>> function()
[1,2]
else:
>>> function()
[1,2,3]
"""

Thank you very much.

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Add if...else...  switch to doctest? David <zhushenli@gmail.com> - 2012-10-18 17:08 -0700
  Re: Add if...else...  switch to doctest? Ben Finney <ben+python@benfinney.id.au> - 2012-10-19 12:29 +1100
  Re: Add if...else...  switch to doctest? Terry Reedy <tjreedy@udel.edu> - 2012-10-18 21:31 -0400
  Re: Add if...else...  switch to doctest? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-19 01:57 +0000
  Re: Add if...else...  switch to doctest? Duncan Booth <duncan.booth@invalid.invalid> - 2012-10-19 09:27 +0000

csiph-web