Patchwork [01,of,10] py3: silence return value of file.write() in test-command-template.t

login
register
mail settings
Submitter Yuya Nishihara
Date March 2, 2018, 12:26 a.m.
Message ID <8d4520c4501899f53310.1519950380@mimosa>
Download mbox | patch
Permalink /patch/28625/
State Accepted
Headers show

Comments

Yuya Nishihara - March 2, 2018, 12:26 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1519937847 18000
#      Thu Mar 01 15:57:27 2018 -0500
# Node ID 8d4520c4501899f53310e536e6bfd174cc58493a
# Parent  761065ed3a186569a1b06b33eadbdfdb7e689df1
py3: silence return value of file.write() in test-command-template.t
Pulkit Goyal - March 2, 2018, 12:34 a.m.
On Fri, Mar 2, 2018 at 5:56 AM, Yuya Nishihara <yuya@tcha.org> wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1519937847 18000
> #      Thu Mar 01 15:57:27 2018 -0500
> # Node ID 8d4520c4501899f53310e536e6bfd174cc58493a
> # Parent  761065ed3a186569a1b06b33eadbdfdb7e689df1
> py3: silence return value of file.write() in test-command-template.t
>
> diff --git a/tests/test-command-template.t b/tests/test-command-template.t
> --- a/tests/test-command-template.t
> +++ b/tests/test-command-template.t
> @@ -2219,7 +2219,7 @@ Age filter:
>    >>> import datetime
>    >>> fp = open('a', 'wb')
>    >>> n = datetime.datetime.now() + datetime.timedelta(366 * 7)
> -  >>> fp.write(b'%d-%d-%d 00:00' % (n.year, n.month, n.day))
> +  >>> fp.write(b'%d-%d-%d 00:00' % (n.year, n.month, n.day)) and None

This sounds like a good way. We need this it at a lot of places.
Pulkit Goyal - March 2, 2018, 12:38 a.m.
Looks good to me. Queued the series. Many thanks.

On Fri, Mar 2, 2018 at 6:04 AM, Pulkit Goyal <7895pulkit@gmail.com> wrote:
> On Fri, Mar 2, 2018 at 5:56 AM, Yuya Nishihara <yuya@tcha.org> wrote:
>> # HG changeset patch
>> # User Yuya Nishihara <yuya@tcha.org>
>> # Date 1519937847 18000
>> #      Thu Mar 01 15:57:27 2018 -0500
>> # Node ID 8d4520c4501899f53310e536e6bfd174cc58493a
>> # Parent  761065ed3a186569a1b06b33eadbdfdb7e689df1
>> py3: silence return value of file.write() in test-command-template.t
>>
>> diff --git a/tests/test-command-template.t b/tests/test-command-template.t
>> --- a/tests/test-command-template.t
>> +++ b/tests/test-command-template.t
>> @@ -2219,7 +2219,7 @@ Age filter:
>>    >>> import datetime
>>    >>> fp = open('a', 'wb')
>>    >>> n = datetime.datetime.now() + datetime.timedelta(366 * 7)
>> -  >>> fp.write(b'%d-%d-%d 00:00' % (n.year, n.month, n.day))
>> +  >>> fp.write(b'%d-%d-%d 00:00' % (n.year, n.month, n.day)) and None
>
> This sounds like a good way. We need this it at a lot of places.

Patch

diff --git a/tests/test-command-template.t b/tests/test-command-template.t
--- a/tests/test-command-template.t
+++ b/tests/test-command-template.t
@@ -2219,7 +2219,7 @@  Age filter:
   >>> import datetime
   >>> fp = open('a', 'wb')
   >>> n = datetime.datetime.now() + datetime.timedelta(366 * 7)
-  >>> fp.write(b'%d-%d-%d 00:00' % (n.year, n.month, n.day))
+  >>> fp.write(b'%d-%d-%d 00:00' % (n.year, n.month, n.day)) and None
   >>> fp.close()
   $ hg add a
   $ hg commit -m future -d "`cat a`"