This is more a conceptual question. I am unit testing a script I wrote that has multiple modules. I have a main.py and a formatting.py. My coverage is at 100% for formatting but my main.py is at 30%. In my main, I just call all of the functions inside formatting. Do i need to just test them again in main directly? This seems like a waste of time? Maybe I am not understanding correctly. Thanks in advance
Usually the trick is to test what external function does by itself and not other functions that are called and are already tested. This is not a problem if internal functions are actually called, just avoid testing them again.
If you want to avoid calling internal functions though, you may try dependecy injection or mocking.
If your external function is simple enough, you may forgo testing it, 100% coverage is not a rule.
unit test main.py with other modules