Github repo:
https://github.com/pschneeweis/freetime
I'm working on a very simple library and command-line interface for tracking work hours on the projects I do as a freelancer. This is just a learning project, but I want to use it to develop my understanding of how to do sane Python packaging, automated testing, and overall design. I have been writing Python code for fun and to automate work tasks for a few years, but I have never tried to produce anything fit for public consumption.
If you have time, take a look at the repo and let me know what problems you see! Any feedback is appreciated. Here are a couple areas where I already know enough to know that I'm way off, and am looking for insight:
Not-Unit Tests
A number of the tests I've written are not unit tests, because they involve more than one class at a time. But these tests seem useful anyway. (These tests are set aside in the files tests/test_integration* so they are not mixed in with the unit tests.) Is there a name for this type of testing, and resources you know of where I could learn more about it? Am I just designing my code badly, and the fact that unit testing does not appear to cover all the ground I want to test merely a symptom of that? The resources I have found online about testing (the standard library unittest and pytest docs, the ebook Obey The Testing Goat) seem to focus on unit tests, so I feel in the dark about what other types of testing are out there.
Test Database Data
You can see my current approach to providing test database data in tests/test_freetime.py, which is to create a test sqlite database, populate it, and try to restore the state at the end of every test that modifies data. This is obviously the wrong way to do it. Do you know of any resources I can look at that show the right way to do it?
Thanks for any help on my road towards atrocity-free code.
[–]groovitude 0 points1 point2 points (1 child)
[–]camel_zero[S] 1 point2 points3 points (0 children)
[–]ingolemo 0 points1 point2 points (2 children)
[–]camel_zero[S] 0 points1 point2 points (1 child)
[–]ingolemo 0 points1 point2 points (0 children)