plotly / plotly/dash

dash_duo: allow for dynamic scoping

Open
#1,437 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature P3
Dominant language
Python
Stars
24.4k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
13

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the dash_duo pytest fixture and its existing fixture-scope configuration. Read pytest's dynamic-scope documentation and inspect how the fixture is used by tests. Done means module-scoped requests can use dash_duo without ScopeMismatch while existing function-scoped behavior remains supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.