[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1833501 - in /subversion/trunk/subversion/tests/cmdline: ./ svntest/

From: Branko Čibej <brane_at_apache.org>
Date: Thu, 14 Jun 2018 11:29:39 +0200

On 14.06.2018 11:02, julianfoad_at_apache.org wrote:
> Author: julianfoad
> Date: Thu Jun 14 09:02:11 2018
> New Revision: 1833501
>
> URL: http://svn.apache.org/viewvc?rev=1833501&view=rev
> Log:
> In the test suite: replace 'open().write()' with a 'with' construct.
>
> The form 'with open() as f: f.write()' is nowadays recommended.
>
> This may fix test failures we were seeing on MacOSX in shelf_tests.py
> test 15 and perhaps test 12.
>
> * subversion/tests/cmdline/*_tests.py
> Use 'with' form instead of 'open().write()'.
>
> * subversion/tests/cmdline/svntest/main.py
> (file_write): Same, and also for 'codecs.open().write()'.
> (file_substitute): Same.
>
> * subversion/tests/cmdline/svntest/sandbox.py
> (Sandbox._ensure_authz): Same.
>
> Modified:
> subversion/trunk/subversion/tests/cmdline/basic_tests.py
> subversion/trunk/subversion/tests/cmdline/blame_tests.py
> subversion/trunk/subversion/tests/cmdline/commit_tests.py
> subversion/trunk/subversion/tests/cmdline/entries_tests.py
> subversion/trunk/subversion/tests/cmdline/export_tests.py
> subversion/trunk/subversion/tests/cmdline/externals_tests.py
> subversion/trunk/subversion/tests/cmdline/lock_tests.py
> subversion/trunk/subversion/tests/cmdline/revert_tests.py
> subversion/trunk/subversion/tests/cmdline/special_tests.py
> subversion/trunk/subversion/tests/cmdline/stat_tests.py
> subversion/trunk/subversion/tests/cmdline/svnadmin_tests.py
> subversion/trunk/subversion/tests/cmdline/svnfsfs_tests.py
> subversion/trunk/subversion/tests/cmdline/svntest/main.py
> subversion/trunk/subversion/tests/cmdline/svntest/sandbox.py
> subversion/trunk/subversion/tests/cmdline/trans_tests.py
> subversion/trunk/subversion/tests/cmdline/tree_conflict_tests.py
> subversion/trunk/subversion/tests/cmdline/upgrade_tests.py
>
> Modified: subversion/trunk/subversion/tests/cmdline/basic_tests.py
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/basic_tests.py?rev=1833501&r1=1833500&r2=1833501&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/tests/cmdline/basic_tests.py (original)
> +++ subversion/trunk/subversion/tests/cmdline/basic_tests.py Thu Jun 14 09:02:11 2018
> @@ -3024,16 +3024,19 @@ def peg_rev_on_non_existent_wc_path(sbox
> # setup some history
> sbox.simple_move('A', 'A2')
> sbox.simple_move('A2/mu', 'A2/mu2')
> - open(sbox.ospath('A2/mu2'), 'w').write('r2\n')
> + with open(sbox.ospath('A2/mu2'), 'w') as f:
> + f.write('r2\n')

I thought we had some kind of utility function for all of these?

-- Brane
Received on 2018-06-14 11:42:00 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.