Unable to execute the user defined hook in conftest by pytest

51 Views Asked by At

Iam trying to create a custom my own hook with naming convention like pytest_new_hook().... In conftest.py file But when iam running a test method iam getting error like INTERNAL ERROR> pluggy._manager.PluginValidationError: unknown hook 'pytest_new_hook' in plugin c://.......conftest.py....

I am learning hooks concept so i tried with inbuilt hooks like pytest_runtest_setup... Those sre working fine.... But when i wnat to define new hook which can auto detects by pytest iam getting above error.... Could you please anyone give me the solution how can i define a custom hook in conftest.py file which can auto detects and run for every test method by pytest......

0

There are 0 best solutions below