Reputation: 417
Say I have a test like this:
self.assertTrue( car.color == 'blue')
I run it with
nosetests test_car.py -x -v --stop
If it fails, I would like it to print out the actual value of car.color. Is there a way to do that?
Upvotes: 1
Views: 51
Reputation: 13779
That's where you need to use self.assertEqual(car.color, 'blue')
. assertTrue
is better for checking boolean properties or expressions that aren't simple equality.
Upvotes: 5