Good question, @schnumbl .
We talked about running tests in PyCharm about a year ago at the Plotly Community meetup. @vestland Do you know how to go about this?
To a) I tried to reproduce the issue with missing dash_duo today but could not. Running and debugging the test in PyCharm just works fine.
Maybe it has been an issue with the webdriver installation or an outdated package or my custom component has not been built correctly with npm run built. If the issue pops up again, I’ll provide code to reproduce it.
To b) I renamed my “conftest.py” (that is located next to the test file) to “plugin.py” and my Firefox configuration below is not considered any more. Maybe the name “plugin.py” is just outdated or the file needs to be at a different location to be considered.
import os
from selenium import webdriver
# In order to apply these settings correctly, you need to
# start pytest with the command line option
# --webdriver Firefox
# pytest --cov --webdriver Firefox
# In PyCharm you can include the
# option as "Additional Arguments" in the run configuration
def pytest_setup_options():
print('Using custom webdriver options defined in conftest.py ...')
options = webdriver.FirefoxOptions()
firefox_path = 'C:/Program Files/Mozilla Firefox/firefox.exe'
if os.path.exists(firefox_path):
options.binary_location = firefox_path
options.headless = True
options.add_argument('--headless')
return options