Skip to content

Instantly share code, notes, and snippets.

@clayg
Created December 6, 2011 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clayg/1440120 to your computer and use it in GitHub Desktop.
Save clayg/1440120 to your computer and use it in GitHub Desktop.
$ cat test.py
from cStringIO import StringIO
expected = 'a'
result = StringIO('a').read()
assert result is expected
expected = 'abc'
result = StringIO('abc').read()
assert result is expected, "%s is not %s" % (repr(result), repr(expected))
$ python test.py
Traceback (most recent call last):
File "test.py", line 7, in <module>
assert result is expected, "%s is not %s" % (repr(result), repr(expected))
AssertionError: 'abc' is not 'abc'
clayg@rosco:~$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment