grantjenks / python-runstats

Python module for computing statistics and regression in a single pass.
http://grantjenks.com/docs/runstats/
Other
96 stars 19 forks source link

Adapt a CI system like Travis #7

Closed FlorianWilhelm closed 7 years ago

FlorianWilhelm commented 7 years ago

Currently one unit test namely test_regression() is not working, at least on my machine. A continuous integration system like Travis would allow you to automatically check all unit tests after every push to the repo. That being said I noticed that the test files test_runstats.py and test_runstats_core.py differ only by a few lines in order to test the cythonized code and the pure python code. I guess there must be a way to avoid this kind of code duplication maybe with some smart usage of py.test fixtures but I am not 100% sure.

FlorianWilhelm commented 7 years ago

Ohh my bad :-/ I there is already one. sorry

FlorianWilhelm commented 7 years ago

@grantjenks Still the test_regression unit test error seems to be unrelated and never worked locally. This is due to the fact that random.seed(0) is set only once at the beginning. That means that adding new unit tests will change the current state of the random variables in each function. This led to the failure of test_regression. The problem with code duplication in test_runstats and test_runstats_core persists....

grantjenks commented 7 years ago

I agree the duplicated code in test_runstats and test_runstats_core is ugly. I did it that way just because it's quick. Opened #8.

I also changed the fitted line in test_regression because it was simply too easy to exceed the error limit.