Xion / pyqcy

QuickCheck-like testing framework for Python
http://xion.io/pyqcy
Other
41 stars 0 forks source link

Print value(s) for which a test failed #9

Closed Xion closed 12 years ago

Xion commented 12 years ago

Now the AssertionErrors thrown by tests are immediately propagated upwards so they land in standard output, or are captured by unit testing library under which the properties are being tested. This loses information which particular testcase has caused the property to fail.

We shall at least include the values in the exception being thrown; it should likely be a custom exception derived from AssertionError. This way, in case of failed tests we will have both the stacktrace (incl. the offending assert that caused the failure) and values for the test case itself.

Xion commented 12 years ago

Implemented. Failed tests now through pyqcy.CheckError which stringifies into message containing the test data which caused failure.