Closed nzdjb closed 3 years ago
First things first, thanks for engaging so much! :) I propose to add you as a collaborator to the repository, then we can commit to the same branches in the PR.
Now, the let's get down to business. Things that are currently on my mind:
test
directory outside of the typetest
directory.poetry run test
option that will run the tests.Currently, I'm working on a well outlined CONTRIBUTING.md, I think that'll help new contributors. Especially those unfamiliar with poetry.
Sure, I'd be happy to be a collaborator, thanks. :-)
Great idea, I'll move the tests out and add the option.
Implemented very basic test for all the logic functions in analyse.
Aham, this currently doesn't test anything, just sets a foundation how the test ought to be written?
The magic mock approach makes sense.
In the long run I think it'd be best if we had some real mock results files for testing (multiple results.csv
s and so on). So that pd.read_csv
can actually read a csv.
Regarding the plt.show
function, we can ignore it as you did, but we can test the plt.plot
function, or which ever is used, and check the arguments that it receives, those are the ones that will be plotted.
It does test a little bit:
They would catch a certain level of bugs e.g. a change causes an exception or the plot to not show at all.
So they're not very thorough or high value tests, but they are testing something. But you're right, the main value is in establishing the foundation.
I agree on the testing purpose. It definitely isn't useless. I didn't mean to downplay your effort in any way. 😅
This is great, I am just trying to establish what needs to be built on top of it!
Hello again!
Adding some unit tests for functions in analyse. Starting with making sure the external calls are mocked correctly and called the appropriate number of times. Planning to build out further into testing logic, though that may benefit from a refactor in a few places.
Creating as draft initially for discussion.
Please complete these tasks before opening your PR:
poetry run flake8
poetry run black .
poetry run python -m unittest