Please improve doc on dash testing: How to run tests in PyCharm?

I would like to run following test in PyCharm, using the green play button symbol next to the line number. However, i get

TypeError: test_render_component() missing 1 required positional argument: 'dash_duo'

=> Is PyCharm not supported at all by dash testing?

Or do I need to consider some specific configuration etc. to get it working?

a) Could you please improve

to include information on running & debugging ploty tests in IDEs like PyCharm and VsCodium?

b) Could you please also clarify where to put the mentioned plugin.py file and whats the differnece to conftest.py mentioned here:

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?

Hi @schnumbl

Could you share an example of a test you are running that throws that error?

TypeError: test_render_component() missing 1 required positional argument: 'dash_duo'

Thank you for your replies.

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