py.test - How do I execute code after pytest generates a report (using pytest)? -


so i'm trying automatically sftp html report (that pytest creates) server after pytest finishes execution. exist in pytest or have create wrapper?

i know there "setup" , "teardown" methods , there exists teardown method can execute after tests have ran, occurs before report generated (not want!).

you can handle in pytest_unconfigure hook. if using pytest-html generate test reports, can access path of reports

# in conftest.py def pytest_unconfigure(config):     html_report = config._html.logfile   # provides full path of generated html report     # or    html_report = config.option.htmlpath  # provides value passed --html command line option    # code upload sftp goes here 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -