{"id":9636,"library":"dash-testing-stub","title":"dash-testing-stub Library","description":"dash-testing-stub is a lightweight Python package, currently at version 0.0.2. Its sole purpose is to serve as a marker or stub dependency within the `dash[testing]` extra, signaling the availability for optional loading of the `pytest-dash` plugin. It is not intended for direct user import or interaction, acting purely as an internal mechanism for conditional feature enablement in Dash testing environments. It is released as part of the official Dash framework.","status":"active","version":"0.0.2","language":"en","source_language":"en","source_url":"https://github.com/plotly/dash/tree/dev/dash-testing-stub","tags":["dash","testing","pytest","stub","internal-dependency"],"install":[{"cmd":"pip install dash[testing]","lang":"bash","label":"Recommended installation (includes testing tools)"},{"cmd":"pip install dash-testing-stub","lang":"bash","label":"Direct installation (not typically needed)"}],"dependencies":[],"imports":[{"note":"dash-testing-stub is an empty stub package. Its presence is detected by `dash[testing]` to enable the pytest-dash plugin. It exports no user-facing symbols.","wrong":"from dash_testing_stub import SomeSymbol","symbol":"*","correct":"This package is not meant for direct import."}],"quickstart":{"code":"# 1. Install Dash with testing extras:\n# pip install dash[testing]\n\n# 2. Create a test file (e.g., test_app.py):\nimport dash\nfrom dash import html\nimport pytest\n\n@pytest.fixture\ndef dash_app():\n    app = dash.Dash(__name__)\n    app.layout = html.Div([html.H1(\"Hello Dash Testing!\"), html.Div(id='output-div')])\n    return app\n\ndef test_initial_layout(dash_duo, dash_app):\n    dash_duo.start_server(dash_app)\n    dash_duo.wait_for_text_to_equal(\"h1\", \"Hello Dash Testing!\", timeout=4)\n    assert dash_duo.driver.find_element_by_tag_name(\"h1\").text == \"Hello Dash Testing!\"\n\n# 3. Run pytest from your terminal in the same directory:\n# pytest","lang":"python","description":"To 'use' `dash-testing-stub`, you typically install `dash[testing]`, which includes it. Then, you can write pytest tests for your Dash applications using the `dash_duo` fixture provided by the `pytest-dash` plugin. The stub package itself has no API to call."},"warnings":[{"fix":"If you need Dash testing capabilities, install `dash[testing]` and use the `pytest-dash` plugin's fixtures (like `dash_duo`) in your tests. Do not import anything directly from `dash_testing_stub` in your application or test code.","message":"Do not attempt to import specific symbols or functionalities from `dash-testing-stub`. It is an empty stub package and contains no Python code beyond its `__init__.py` (which is empty). Its purpose is solely to act as a flag for the `dash[testing]` extra.","severity":"gotcha","affected_versions":"0.0.1 - 0.0.2 (all versions)"},{"fix":"Always install the testing dependencies using `pip install dash[testing]`. This ensures all necessary components, including the `pytest-dash` plugin, are correctly installed and configured.","message":"Installing `dash-testing-stub` directly via `pip install dash-testing-stub` will not provide the full testing suite. It only installs the empty stub package. The complete `pytest-dash` plugin and related tools are part of the `dash[testing]` extra.","severity":"gotcha","affected_versions":"0.0.1 - 0.0.2 (all versions)"},{"fix":"Treat `dash-testing-stub` as an opaque dependency. Focus on the `dash[testing]` ecosystem and `pytest-dash` plugin for your testing needs.","message":"This package is an internal dependency of Dash's testing infrastructure. It is not designed for independent use or extension.","severity":"gotcha","affected_versions":"0.0.1 - 0.0.2 (all versions)"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"The `dash-testing-stub` package is an empty marker package and contains no exportable symbols. Remove any `from dash_testing_stub import ...` statements from your code. If you need Dash testing tools, ensure you've installed `dash[testing]` and use the `pytest-dash` plugin features.","cause":"Attempting to import a non-existent function or class from the `dash-testing-stub` package.","error":"ImportError: cannot import name 'SomeFunction' from 'dash_testing_stub' (unknown location)"},{"fix":"The `dash-testing-stub` module is empty and does not expose any attributes or methods. It exists purely as a dependency marker. Do not attempt to access attributes on it. Install `dash[testing]` and refer to the `pytest-dash` documentation for how to use Dash's testing fixtures.","cause":"Mistakenly treating `dash_testing_stub` as a module that provides functions or objects after importing it.","error":"AttributeError: module 'dash_testing_stub' has no attribute 'some_method'"}]}