Hi Amish, to run/debug pytest scripts in Eclipse, you first need to to install Pydev on Eclispe. You can get PyDev from Eclipse Marketplace and configure it to write Python Selenium test scripts or Pytest scripts in Selenium.
Now follow these steps:
- Navigate to Window -> Preferences -> PyDev -> PyUnit
- Change the test runner to "py.test runner" and clear the parameters like --verbosity0 (or add the ones you prefer. Make sure they are valid flags for pytest.)
- Finally, right click on the pytest script you want to run and click on Run As and select Python Unit-test. This will run your pytest script as unit test.