plotly / dash

Data Apps & Dashboards for Python. No JavaScript Required.
https://plotly.com/dash
MIT License
21.55k stars 2.08k forks source link

dash_duo: allow for dynamic scoping #1437

Open VeraZab opened 4 years ago

VeraZab commented 4 years ago

Is your feature request related to a problem? Please describe. when using dash_duo selenium test fixture with pytest, I'm facing this error: ScopeMismatch: You tried to access the 'function' scoped fixture 'dash_duo' with a 'module' scoped request object, involved factories It arises as I'm trying to refactor my tests and only run certain expensive operations once (ie: authenticating to DE) per test module, rather than once per test function

Describe the solution you'd like I see that it's possible to have fixture scope set dynamically: https://docs.pytest.org/en/stable/fixture.html#dynamic-scope and wondering if we could implement something like this for the dash_duo fixture

cc @Marc-Andre-Rivet @alexcjohnson

VeraZab commented 4 years ago

'dash_br' also has this issue of being function scoped, and its probably in my case the fixture I should be using as I just need a browser in my tests..