[pytest-dev] Preserving capture fd from fixture setup?

Nikolaus Rath Nikolaus at rath.org
Thu May 19 15:34:43 EDT 2016


Hello,

I am testing a server. I am starting the server in a subprocess from a
fixture, and then issue requests to it from various tests. Unfortunately
this seems to have one big drawback: when a test fails, the capture
plugin does not display any output from the server process.

After looking at the code, I think this is because the capture plugin
creates a new file descriptor for each test phase (setup, call,
teardown).

Would it be possible to instead re-use the same fd, and distinguish
between phases by recording the position after each phase?

If this sounds feasible and desireable, then I'll work on a pull
request.


Best,
-Nikolaus

-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«


More information about the pytest-dev mailing list