Overriding/skipping a hook #11302
-
Hello, I got a defined pytest_runtest_setup in my conftest that sets up my target for general testing but for certain testcases i either want a different setup method or just want to skip it as the setup is not needed. Is there a way to override or skip the defined pytest_runtest_setup in my conftest? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hooks cannot be overridden/skipped easily Id recommend using the use fixtures marker plus a fixture if you want to have better control over what Tests use a fixtures I also recommend to outline the concrete use case in more detail to ensure more to the point advice |
Beta Was this translation helpful? Give feedback.
if one file needs the fixture, and the other file now, jsut make a usefixtures mark for the second file and/or have a private autouse fixture in one of the files