Testing logging output of a non-python application #11105
-
I have an HTTP server application which files various abnormal situations (including which do not warrant HTTP error code) into logs. I am testing it with a pytest at the moment. Part of environment setup is making a config file which is stored in temporary folder, and tells application to write logs into said temporary folder as well (no log rotation, nothing which can make it too complex). When it came to actually consuming that file from within pytest, I struggle to find any relevant plugin which would read log file (plus optionally parse it according to specified format into log entry objects) and conveniently expose it to tests. Is there any plugin which does that? If not, are there similar tools for reading and parsing stdout? Or should I just write my own plugin to support that? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
There isn't,the topic is out of scope for pytest There may be python libraries too parse the logs |
Beta Was this translation helpful? Give feedback.
-
I thought pytest was getting used to test applications of all kinds, even non-python ones. Alright, will write something myself then, thanks |
Beta Was this translation helpful? Give feedback.
There isn't,the topic is out of scope for pytest
There may be python libraries too parse the logs