Skip to content

junitxml output capture while going to console #4593

Closed
@csm10495

Description

@csm10495

Thanks for submitting an issue!

Here's a quick checklist in what to include:

  • [x ] Include a detailed description of the bug or suggestion

I'd like a way to output print-ed output in real time and also collect it in junitxml output. Right now if I use -s I get it in console but not in the junitxml. If I don't use -s, I only get it in the junitxml.

The reason this is useful to me is because there are cases where my tests can hang at the OS level and having the output on the console at the time of the freeze can be incredibly useful. Ultimately my CI uses the junitxml for parsing in the event that testing doesn't hang.

Normally the tests don't hang, but when they do, or we need debug, -s is incredibly useful.

  • [ x] pip list of the virtual environment you are using

Package Version


altgraph 0.16.1
asn1crypto 0.24.0
astroid 1.6.5
atomicwrites 1.2.1
attrs 18.2.0
Autologging 1.2.1
backports-abc 0.5
backports.functools-lru-cache 1.5
backports.shutil-get-terminal-size 1.0.0
bcrypt 3.1.4
certifi 2018.10.15
cffi 1.11.5
chardet 3.0.4
Click 7.0
colorama 0.4.1
configparser 3.5.0
construct 2.5.3
coverage 4.5.1
cryptography 2.3.1
decorator 4.3.0
dill 0.2.8.2
dis3 0.1.2
docopt 0.6.2
docutils 0.14
entrypoints 0.2.3
enum34 1.1.6
flaky 3.4.0
funcsigs 1.0.2
future 0.16.0
futures 3.2.0
git-lint 0.1.2
haystack 0.42
html-linter 0.4.0
htmlmin 0.1.12
idna 2.7
ipaddress 1.0.22
ipython 5.8.0
ipython-genutils 0.2.0
isort 4.3.4
Jinja2 2.10
keyring 17.0.0
lazy-object-proxy 1.3.1
livereload 2.5.2
macholib 1.11
Markdown 2.6.11
markdown-fenced-code-tabs 1.0.3
MarkupSafe 1.1.0
mccabe 0.6.1
mercurial-extension-utils 1.3.7
mercurial-keyring 1.2.1
mkdocs 1.0
mock 2.0.0
more-itertools 4.3.0
nose 1.3.7
numpy 1.15.1
pandas 0.23.4
paramiko 2.4.2
pathlib2 2.3.2
pbr 4.2.0
pefile 2018.8.8
pickleshare 0.7.5
pip 18.0
pita 0.0.4
pluggy 0.7.1
plumbum 1.6.7
prettytable 0.7.2
prompt-toolkit 1.0.15
protobuf 3.6.1
psutil 5.4.7
py 1.6.0
pyasn1 0.4.4
pycparser 2.19
pycryptodome 3.6.6
Pygments 2.2.0
PyInstaller 3.3.1
pylint 1.9.4
PyNaCl 1.2.1
pypiwin32 219
pyreadline 2.1
pyserial 2.7
pytest 4.0.2
pytest-cov 2.6.0
pytest-html 1.19.0
pytest-metadata 1.7.0
python-dateutil 2.7.3
python-ptrace 0.9.3
pytz 2018.5
pywin32-ctypes 0.2.0
PyYAML 3.13
pyzmq 17.1.2
requests 2.20.1
rpyc 4.0.2
scandir 1.9.0
scipy 1.1.0
setuptools 28.8.0
simplegeneric 0.8.1
singledispatch 3.4.0.3
six 1.12.0
template-remover 0.1.9
termcolor 1.1.0
tornado 5.1.1
traitlets 4.3.2
urllib3 1.24.1
wcwidth 0.1.7
wget 3.2
win-unicode-console 0.5
WMI 1.4.9
wrapt 1.10.11
xlrd 1.1.0
zmq 0.0.0

  • pytest and operating system versions

Python 2.7.13, pytest-4.0.2, py-1.6.0, pluggy-0.7.1
Microsoft Windows [Version 10.0.16299.665]

  • Minimal example if possible

Maybe something like: python -m pytest -s --junitxml=file.xml -capture=junit

If something like this already exists, please let me know. :)

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions