Closed nzdjb closed 3 years ago
Nice one! I was just thinking about that an hour ago. 🪙 🌊 🦷? (coin-sea-dense -> coincidence? 😂 )
Have you seen #24? Do you have any ideas on that front.
The util functions tests are of less priority, typetest
and typetest-analyse
are more important I think.
Great emoji pun :-P
No, hadn't seen that yet.
I think the best approach is to start with unit testing as much a possible and then look at e2e.
Could possibly produce images of the plots and compare them to known good images. Has a tendency to be a bit brittle though.
Yeah, unit test should be the priority. I hope matplotlib/pyplot/seaborn have some way to test the state of the backend before plotting. Comparing images is the last thing I'd look into (although it's minimal effort, I believe it is slow and error prone, especially if you take into account font rendering).
Yep, will be interesting to look into.
Will try to have a bash at testing the app logic with test doubles where appropriate this evening. I'd like to merge this prior to significant work on the testing so the groundwork is in place if anyone else wanted to add tests in parallel.
There's an example of the test workflow running at https://github.com/nzdjb/typetest/pull/2/checks
One more for you. I've added a quick set of tests for the def damerau_levenshtein_distance function. Went with unittest to keep it simple.
Also added docs for running the tests and a quick workflow to run them on each push.
Please complete these tasks before opening your PR:
poetry run flake8
poetry run black .
poetry run python -m unittest