bitprophet / spec

Specification-style nosetests output for Python
MIT License
95 stars 16 forks source link

Test failures don't show class name #41

Open mehaase opened 8 years ago

mehaase commented 8 years ago

I wrote a package that can interface with several different database systems (e.g. MySQL and Postgres). I wrote my integration tests as an abstract base class, and then wrote a concrete implementation for each database system. This way, each database runs the same battery of integration tests.

The downside of this approach is that all the test methods are shared between the test classes, so they all print out the same docstring when they run. If a test fails, it's not obvious which test class the failure occurred in.

Spec seems like a nice solution to this, since it clearly identifies which test class is running.

test runner output

Unfortunately, when an error occurs, only the method docstring is displayed, not the class, making the error ambiguous as to which test failed.

test exception

The exception message would be improved if it included the name of the test class.

bitprophet commented 8 years ago

Yup this has bedeviled me for ages. Surprised I never made my own ticket for it. Thanks for the report! Happy to consider a patch if you come up with one.