mgedmin/objgraph

Add unittest coverage

pcostell opened this issue · 2 comments

Right now, many of the tests are essentially unittests but are written using the doctests. If these were made unittests it would be easier to add additional coverage.

I've no objections. I mostly wrote doctests because I believed at the time that they lead to more readable tests. They have some downsides: it's harder to share test setup code between doctests.

BTW for coverage purposes it's much easier to write isolated doctests like https://github.com/mgedmin/objgraph/blob/master/tests.py#L218-L228 than to try to extend one of the txt files in https://github.com/mgedmin/objgraph/tree/master/docs. Adding unittest.TestCase-based unit tests to tests.py would be more or less equivalent to adding a new doctest_xxx function, IMHO.

This is fixed, I think?