How to test or mock “if __name__ == ‘__main__'” contents
I will choose another alternative which is to exclude the if __name__ == ‘__main__’ from the coverage report , of course you can do that only if you already have a test case for your main() function in your tests. As for why I choose to exclude rather than writing a new test case for … Read more