[Python-Dev] PEP 574 ready for review

2019-04-30 Thread Antoine Pitrou


Hello,

I've put the final touches to PEP 574 - Pickle protocol 5 with
out-of-band data (*).  It is now ready for review.  The implementation
is fully functional, as well as its PyPI backport (**), and has
regression tests against Numpy.  Numpy and PyArrow have their own tests
against the pickle5 backport.

(*) https://www.python.org/dev/peps/pep-0574/

(**) https://pypi.org/project/pickle5/

Regards

Antoine.


___
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


[Python-Dev] drop jython support in mock backport?

2019-04-30 Thread Chris Withers

[resending to python-dev in case there are Jython users here...]

Hi All,

If you need Jython support in the mock backport, please shout now:

https://github.com/testing-cabal/mock/issues/453

cheers,

Chris

___
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


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

2019-04-30 Thread Chris Withers

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.

How would people feel about these going away? I don't *think* they're 
needed now that we have unittest discover, but thought I'd ask.


Chris

___
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


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

2019-04-30 Thread Robert Collins
They were never needed 😁

Removal is fine with me.

On Wed, 1 May 2019, 09:27 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.
>
> How would people feel about these going away? I don't *think* they're
> needed now that we have unittest discover, but thought I'd ask.
>
> Chris
>
> ___
> 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/robertc%40robertcollins.net
>
___
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


Re: [Python-Dev] drop jython support in mock backport?

2019-04-30 Thread Jeff Allen

Cross-posting to jython-users for obvious reasons.

Jeff Allen

On 30/04/2019 10:26, Chris Withers wrote:

[resending to python-dev in case there are Jython users here...]

Hi All,

If you need Jython support in the mock backport, please shout now:

https://github.com/testing-cabal/mock/issues/453

cheers,

Chris

___
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


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

2019-04-30 Thread Terry Reedy

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


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

2019-04-30 Thread Chris Withers

On 01/05/2019 06:12, Terry Reedy wrote:
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:


Which .coveragerc are you referring to? There isn't one in the cpython 
repo and a current release of coverage.py doesn't appear to exclude 
these lines for me:


https://circleci.com/gh/testing-cabal/mock/20

(line 44 in mock/tests/testsentinel.py)

Chris
___
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


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

2019-04-30 Thread Serhiy Storchaka

01.05.19 00:24, Chris Withers пише:

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.

How would people feel about these going away? I don't *think* they're 
needed now that we have unittest discover, but thought I'd ask.


These lines were added for purpose. They are needed for running tests in 
separate file as a script.


$ ./python Lib/unittest/test/testmock/testcallable.py -v
test_attributes (__main__.TestCallable) ... ok
test_create_autospec (__main__.TestCallable) ... ok
test_create_autospec_instance (__main__.TestCallable) ... ok
test_hierarchy (__main__.TestCallable) ... ok
test_non_callable (__main__.TestCallable) ... ok
test_patch_spec (__main__.TestCallable) ... ok
test_patch_spec_callable_class (__main__.TestCallable) ... ok
test_patch_spec_instance (__main__.TestCallable) ... ok
test_patch_spec_set (__main__.TestCallable) ... ok
test_patch_spec_set_instance (__main__.TestCallable) ... ok
test_subclasses (__main__.TestCallable) ... ok

--
Ran 11 tests in 0.040s

OK

___
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