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

Re: Sparse checkouts suggestion

From: Paul Hammant <paul_at_hammant.org>
Date: Sat, 16 Sep 2017 14:06:59 -0400

>
>
> foo.py:
>
> import os
> def my_mocked_os_system(*args, **kwargs):
> print('a mockery')
> os.system = my_mocked_os_system
>
>
> bar.py:
>
> import os
> os.system("echo bar")
>
> import foo
> os.system("echo foo")
>
>
> Then:
>
> $ PYTHONPATH=. python bar.py
> bar
> a mockery
>
>
I've spent the last 5 hours looking at mock decorators for Python (and
MagicMock and stackoverflow and blogs). I can't get it working on my own -
I'm not experienced enough with Python. Specifically, I can't do it *less*
lines of code and have it the correct Pythonic way. I need help from
someone that's prepared to remote pair on it.

- Paul
Received on 2017-09-16 20:07:13 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.