A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2019-May/157270.html below:

[Python-Dev] "if __name__ == '__main__'" at the bottom of python unittest files

[Python-Dev] "if __name__ == '__main__'" at the bottom of python unittest files [Python-Dev] "if __name__ == '__main__'" at the bottom of python unittest filesChris Withers chris at withers.org
Wed May 1 08:56:44 EDT 2019
Sorry, accidentally include a comment for this in a reply to Paul:

On 01/05/2019 13:39, Serhiy Storchaka wrote:
> We try to support several different ways of running tests. This allows 
> to catch some environment depended flaws in tests and serves as a kind 
> of the test of unittest itself. Not all test files are made discoverable 
> yet, but we move in this direction.

I'm not sure I understand how triggering via unittest or via unittest 
(no typo, both these __main__ blocks and python -m unittest are using 
the same test runner) could make a difference.

And sorry, to be clear, I'm only taking about the ones in 
unittest/mock/testmock - Rob Collins confirmed these where never needed 
in a private reply:

> They were never needed 😁
> 
> Removal is fine with me.


Chris
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4