Well, I was just thinking that all scripts that are exposed using
console_scripts entry point from setup.py could be tested in a similar way
to how the standard script wrappers run this code. We would need to mock
some things and do clean up afterwards and it would work for most simple
use cases. So this indeed doesn't seem like a lot of code, but it would be
useful. Perhaps not only for me.


On Thu, Apr 28, 2016 at 2:14 PM Ronny Pfannschmidt <[email protected]>
wrote:

>
>
> click for example ships libraries for testing commandlines made with it
>
> my current impression is that
> typically command line applications are opinionated enough,
> that deep integration is very custom and shallow integration is so shallow
>
> a plugin would either be application specific or so small that many
> wouldn't see much value in it
>
> that being said, my impression is a sad one, and i'd love to be shown wrong
>
> On Thu, Apr 28, 2016 at 1:55 PM, Vasily Kuznetsov <[email protected]>
> wrote:
>
>> Hi!
>>
>> I was recently writing some tests for a bunch of console scripts. I ended
>> up having a parametrised function that can run a script for real (using
>> subprocess.run) or can import its main function, mock the environment and
>> execute it in the same process (this is much faster).
>>
>> I've done similar things before and in general this seems to be a
>> reasonably common use case. I couldn't find a pytest plugin for testing
>> console scripts, so I'm wondering if it would be useful to create one. What
>> do you think?
>>
>> Cheers,
>> Vasily
>>
>> _______________________________________________
>> pytest-dev mailing list
>> [email protected]
>> https://mail.python.org/mailman/listinfo/pytest-dev
>>
>>
_______________________________________________
pytest-dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pytest-dev

Reply via email to