dendrograms/dendro-core — pull request #2 by astrofrog (2012-10-23 14:23:33+00:00)
Title: Tidied up imports and testing

This PR changes from using unittest to py.test for testing (which has a number of advantages, such as parametrized tests, coverage tests, etc.). This involves:

* including ``runtests.py`` at the root of the package directory (this should not be moved to e.g. ``scripts``) as it should not be installed, and update ``setup.py`` appropriately. Note that ``runtests.py`` contains everything needed to run py.test, so no need to install it as a separate dependency.

* changing all the ``unittest`` specific syntax to normal asserts, which py.test understands - this makes the asserts more readable in my opinion

* removing all absolute imports in ``astrodendro``

To run tests:

```
python setup.py test
```

Note that one test is failing due to a change from ``assertItemsEqual`` to ``assert np.all(x == y)`` which I am not sure if it is correct. @bradenmacdonald - what were you intending to do with ``assertItemsEqual``? That function just asserts that the elements have elements with the same length, but not that the actual values are equal - is that intentional?

I also used this as a chance to fix PEP8 warnings, but it makes the diff harder to read. To ignore whitespace changes, check out this PR at the following URL:

https://github.com/astrofrog/dendro-core/pull/new/fix-imports-and-testing?w=0

(adding ``?w=0`` makes it ignore whitespace)

I also moved ``benchmark.py`` outside the source package, as I don't *think* it belongs in the installed source.

@bradenmacdonald and @ChrisBeaumont - let me know what you think!