subversion-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Branko Čibej <>
Subject Re: Sparse checkouts suggestion
Date Thu, 14 Sep 2017 13:42:29 GMT
On 14.09.2017 15:29, Paul Hammant wrote:
>     Yes, that one's pretty nice, but as a rule we try not to burden our
>     users with dependencies outside the standard library. The script uses
>     os.system, what, twice? Hardly worth replacing.
>     On the other hand, we have wrappers around subprocess.Popen in
>     subversion/tests/cmdline/svntest/; you should be able to
>     recycle
>     those.
> I wasn't suggesting any change to os.system for this script. I'm just
> adding tests. I couldn't find decent examples of os.system mocking
> (and stderr/out) so I did it old-school style. Mocking in Python is a
> mess. No cohesive 'winning' approach/framework, and how-to information
> not consolidated anywhere.

Well, well, well.

import os
def my_mocked_os_system(*args, **kwargs):
    print('a mockery')
os.system = my_mocked_os_system

import os
os.system("echo bar")

import foo
os.system("echo foo")


$ PYTHONPATH=. python 
a mockery


-- Brane

View raw message