Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide tests for __name__ == "__main__" sections #178

Closed
jakirkham opened this issue Mar 25, 2015 · 1 comment
Closed

Provide tests for __name__ == "__main__" sections #178

jakirkham opened this issue Mar 25, 2015 · 1 comment

Comments

@jakirkham
Copy link
Member

It would be nice to provide tests for sections of code that rely on __name__ == "__main__". Currently, this is ignored by the tests and coverage, but it would be desirable to test this anyway. This should be possible using imp.load_source from the builtin module imp. Notable mention to other strategies from StackOverflow ( http://stackoverflow.com/questions/5850268/how-to-test-or-mock-if-name-main-contents ).

@jakirkham
Copy link
Member Author

These sections have been eliminated from the modules. There are some stubs created in the bin directory that are not tested. However, such an involved solution is not required for them.

Simply running --help should be sufficient to make sure they exist and are running roughly correctly. As all of them call a main function that is heavily tested, there is nothing else that needs to be done. This is considered a different issue and has been placed here ( #245 ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant