[TIP] spawning a subprocess from within a pytest test

Bruno Oliveira nicoddemus at gmail.com
Mon Oct 1 17:56:59 PDT 2018


Hi Tony,

There's nothing in pytest that prevents you to spawn subprocesses. Posting
your code and the error or problem you are having will probably help
(specially if the code is small and reproduces the issue).

Cheers,
Bruno

On Mon, Oct 1, 2018 at 8:51 PM Tony Cappellini <cappy2112 at gmail.com> wrote:

>
> I've spent a lot of time trying to figure this out, so I thought I'd ask
> those who have more experience with Pytest.
>
> I'm running Python 2.7.14 on Windows 7 Pro (64-bit), pytest 3.5.0
>
> Is there any reason a test running under pytest shouldn't spawn a
> subprocess, or
> take special care when spawning it?
>
> I'm not able to get a subprocess to launch using subprocess.Popen() inside
> of a pytest test, but I can run spawn the subrpocess outside of pytest.
>
> I don't know if I can attach my code to this post.
>
> I'll provide more details and the code, after the reply.
>
> Thanks
>
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20181001/34675b71/attachment.htm>


More information about the testing-in-python mailing list