Skip to content

Instantly share code, notes, and snippets.

@rlan
Created June 13, 2018 07:20
Show Gist options
  • Select an option

  • Save rlan/9770cea28571deed82dde82d2435e8dc to your computer and use it in GitHub Desktop.

Select an option

Save rlan/9770cea28571deed82dde82d2435e8dc to your computer and use it in GitHub Desktop.
Ask python doctest to ignore output

Some functions return the self object. In this case, the object is an instance at an address. We want to ignore this output:

I found it easier to simply assign the unneeded return values to a variable:

>>> _ = do_something()
>>> check_something()
True

https://stackoverflow.com/a/22537703/1704566

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment