9seconds/streams — pull request #4 by eykd (2014-11-22 05:39:20+00:00)
Title: More tests!

While I was playing around with re-implementing the Stream class, I ended up writing a lot of tests. I took some time the other evening to integrate my tests into yours. I also took the liberty of restructuring the tests a bit. If you object to any of this, I can recompose this PR to your liking. Here's what I've done:

- added `test-requirements.txt` to formalize what tools to use for testing
- added `nose` as the test runner of choice
- added `coverage` plugin to get a sense of what might still need tests written
- formalized `pep8` testing
- added new `run_tests.sh` script for local dev, to quickly run `pep8` and `nosetests` in the current python
- added `tox` configuration to test in py26, py27, py34, and pypy
- fixed some py3k incompatibilities uncovered during testing
- moved `tests.py` to `tests/test_stream.py`, removed the execute bit (so nose will discover it). The plan here is to add more test modules for the untested modules, and let nose handle discovery.

Test coverage for `streams.stream` is now 100%, and overall coverage is 91%:

```
$ ./run_tests.sh
......................................................
Name Stmts Miss Cover Missing
-----------------------------------------------------------
streams 2 0 100%
streams.executors 11 3 73% 31-33
streams.executors.executors 19 9 53% 32-33, 36-43
streams.executors.mixins 36 7 81% 43, 64-67, 91-92
streams.iterators 35 0 100%
streams.poolofpools 108 13 88% 63-64, 84, 183-185, 207, 237, 255-259
streams.stream 185 0 100%
streams.utils 116 16 86% 90-91, 209-210, 275, 301, 305, 309, 313, 317, 321-325, 335
-----------------------------------------------------------
TOTAL 512 48 91%
----------------------------------------------------------------------
Ran 54 tests in 0.188s

OK
```