You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 27, 2024. It is now read-only.
Hi thanks for publishing this project. We're doing something similar and I'd love to share some things that we've done.
pytest has better built-in support for logging, both capturing, live-logging, and writing to the junit-xml file (pytest-dev/pytest#3156). Log files are usually written in pytest_sessionfinish so we need them to propagate to the main process.
We solved this with the following:
## main process
class _ReEmitHandler(logging.Handler):
def handle(self, record):
logging.getLogger(record.name).handle(record)
log_queue = manager.Queue()
listener = logging.handlers.QueueListener(log_queue, _ReEmitHandler)
listener.start()
## subprocess
root = logging.getLogger()
root.handlers.clear()
root.addHandler(logging.handlers.QueueHandler(log_queue))
... run tests
Interested in a PR?
The text was updated successfully, but these errors were encountered:
I'm very interested in a PR, but would prefer that we not track the features branch too closely re: junit-xml logging. A clear path of working w/ core plugin changes remains to be developed.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi thanks for publishing this project. We're doing something similar and I'd love to share some things that we've done.
pytest has better built-in support for logging, both capturing, live-logging, and writing to the junit-xml file (pytest-dev/pytest#3156). Log files are usually written in
pytest_sessionfinish
so we need them to propagate to the main process.We solved this with the following:
Interested in a PR?
The text was updated successfully, but these errors were encountered: