mgedmin / objgraph

Visually explore Python object graphs
http://mg.pov.lt/objgraph/
MIT License
753 stars 72 forks source link

Add unittest coverage #11

Closed pcostell closed 9 years ago

pcostell commented 9 years ago

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.

mgedmin commented 9 years ago

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.

mgedmin commented 9 years ago

This is fixed, I think?