[TIP] Boolean testing frameworks?

Florian Bruhin me at the-compiler.org
Tue Mar 14 05:18:53 PDT 2017


* Robert Gomułka <robert.zbigniew.gomulka at gmail.com> [2017-03-14 13:08:20 +0100]:
> 4. Using the proposed code leads to unhelpful output:
> >>> a = 1; b = 2
> 
> >>> assert a == 1 and b == 3
> ---------------------------------------------------------------------------
> AssertionError                            Traceback (most recent call last)
> <ipython-input-207-bfcde1dea443> in <module>()
> ----> 1 assert a == 1 and b == 3
> 
> AssertionError:

Not when you use pytest:

		def test_foo():
			a = 1
			b = 2
	>       assert a == 1 and b == 3
	E       assert (1 == 1 and 2 == 3)

	x.py:4: AssertionError

Florian

-- 
http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20170314/8118b877/attachment-0001.pgp>


More information about the testing-in-python mailing list