From 8799878288f046c791cc6c624f236347cb74936a Mon Sep 17 00:00:00 2001 From: philippe Date: Wed, 11 May 2022 16:48:20 -0400 Subject: [PATCH 1/2] Fix import error when running pytest but dash[testing] not installed. --- dash/testing/plugin.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dash/testing/plugin.py b/dash/testing/plugin.py index 2fd5b7a21c..4265589259 100644 --- a/dash/testing/plugin.py +++ b/dash/testing/plugin.py @@ -1,4 +1,6 @@ # pylint: disable=missing-docstring,redefined-outer-name +from typing import Any + import pytest from .consts import SELENIUM_GRID_DEFAULT @@ -13,7 +15,15 @@ from dash.testing.browser import Browser from dash.testing.composite import DashComposite, DashRComposite, DashJuliaComposite except ImportError: - pass + # Running pytest without dash[testing] installed. + ThreadedRunner = Any + ProcessRunner = Any + RRunner = Any + JuliaRunner = Any + Browser = Any + DashComposite = Any + DashRComposite = Any + DashJuliaComposite = Any def pytest_addoption(parser): From 77938076dd451eacb4795b158fc75110e2718fd7 Mon Sep 17 00:00:00 2001 From: philippe Date: Wed, 11 May 2022 16:54:09 -0400 Subject: [PATCH 2/2] Update changelog. --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a97fb00db..a57e48e0f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to `dash` will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/). +## [UNRELEASED] + +### Fixed + +- Fix [#2045](https://github.com/plotly/dash/issues/2045) import error when using pytest but `dash[testing]` is not installed. + ## [2.4.0] - 2022-05-11 ### Added