Artefact upload in CI pipelines #81
-
I'm wondering how to best determine where the obtained/diff files are located after a test failure, so I can those to my artefact upload in a CI pipeline. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
That https://github.com/pytest-dev/pytest/blob/main/src/_pytest/tmpdir.py Hope this helps! |
Beta Was this translation helpful? Give feedback.
That
basedir
comes from the builtintmpdir
plugin, so it can be accessed throughconfig._tmp_path_factory.getbasetemp()
from some hook (for examplepytest_sessionfinish
, throughsession.config
). You could implementpytest_sessionfinish()
in your root conftest file and upload the files you need programatically.https://github.com/pytest-dev/pytest/blob/main/src/_pytest/tmpdir.py
Hope this helps!