File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change 1
1
import mock
2
2
import dash
3
3
from dash import dcc , html # noqa: F401
4
- import sys
5
4
6
5
from dash .development .base_component import ComponentRegistry
7
6
@@ -112,15 +111,14 @@ def test_collect_and_register_resources(mocker):
112
111
)
113
112
with mock .patch ("dash.dash.os.stat" , return_value = StatMock ()):
114
113
with mock .patch ("dash.dash.importlib.import_module" ) as import_mock :
115
- sys .modules ["dash_html_components" ] = dcc
116
-
117
- import_mock .return_value = dcc
118
- app ._collect_and_register_resources (
119
- [
120
- {
121
- "namespace" : "dash_html_components" ,
122
- "relative_package_path" : "dash_html_components.min.js" ,
123
- },
124
- ]
125
- )
126
- import_mock .assert_any_call ("dash_html_components" )
114
+ with mock .patch ("sys.modules" , {"dash_html_components" : dcc }):
115
+ import_mock .return_value = dcc
116
+ app ._collect_and_register_resources (
117
+ [
118
+ {
119
+ "namespace" : "dash_html_components" ,
120
+ "relative_package_path" : "dash_html_components.min.js" ,
121
+ },
122
+ ]
123
+ )
124
+ import_mock .assert_any_call ("dash_html_components" )
You can’t perform that action at this time.
0 commit comments