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

Karthikeyan tir.karthi at gmail.com
Wed May 1 09:52:23 EDT 2019


On Wed, May 1, 2019 at 6:13 PM Serhiy Storchaka <storchaka at gmail.com> wrote:

> 01.05.19 10:09, Chris Withers пише:
> > Right, but that's not the documented way of running individual suites in
> > the devguide.
> >
> > I'm happy to remove these on the basis that there should be one and only
> > one way of doing things like this.
>
> This principle is not applicable here because the Python testsuite is
> not a public API. It is not for use of Python users.
>
> 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.
>

Agreed. This also has helped in the past to find issues like
https://bugs.python.org/issue29512#msg299045.


>
> I do not see what is wrong here and suggest to not break working code.
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> https://mail.python.org/mailman/options/python-dev/tir.karthi%40gmail.com
>


-- 
Regards,
Karthikeyan S
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20190501/913dbe5b/attachment.html>


More information about the Python-Dev mailing list