Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pytest Run a Start-up Script

Tags:

pytest

Before pytest actually collects and executes my module , I need to run an external start-script from another module to do some patching, i would like to edit the pytest source. Where exactly in pytest source code should I edit to achieve this? I mean my start-up script must run by default before all other activities. Any pointers will be appreciated.

like image 558
Arun Chandramouli Avatar asked Jan 21 '26 03:01

Arun Chandramouli


1 Answers

Add conftest.py to your project home folder and your startup lay in pytest_sessionstart()

def pytest_sessionstart(session):
    pass

ref. hook starting

like image 185
Nam G VU Avatar answered Jan 26 '26 14:01

Nam G VU