Show expected output in test-case error

It can get a bit confusing as to what test is looking for what result.
Add a message to the failure case to clear things up.  Looks like:

---
 raise mismatch_error
MismatchError: 1 != 2: Error at pos 1, expected [1, 2, 3, 1] and got [1, 1, 1, 1]
======================================================================
---

TrivialFix

Change-Id: I40b57394b270f419b032301f490d4ba791c66396
This commit is contained in:
Ian Wienand 2014-06-19 11:23:27 +10:00
parent 0dc4b59b7d
commit 1d5397ee8a

View File

@ -65,7 +65,11 @@ class AllocatorTestCase(BaseTestCase):
for i, amount in enumerate(self.results):
print self.agt[i]
for i, amount in enumerate(self.results):
self.assertEqual(self.agt[i].amount, amount)
self.assertEqual(self.agt[i].amount, amount,
'Error at pos %d, '
'expected %s and got %s' % (i, self.results,
[x.amount
for x in self.agt]))
class MySQLSchemaFixture(fixtures.Fixture):