On 4/30/2019 5:24 PM, Chris Withers wrote:
Hi All,

I have a crazy idea of getting unittest.mock up to 100% code coverage.

I noticed at the bottom of all of the test files in testmock/, there's a:

if __name__ == '__main__':
     unittest.main()

...block.

Such blocks should be excluded from coverage by the default .coveragerc file. Mine came with

exclude_lines =
    # Don't complain if non-runnable code isn't run:
    if 0:
    if __name__ == .__main__.:
    if DEBUG:


--
Terry Jan Reedy


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to