@@ -7,27 +7,30 @@ def test_dependencies_not_imported():
7
7
8
8
# Check that creating a figure without using numpy and pandas does not result in
9
9
# the import of numpy and pandas, even if they are installed.
10
- assert ' plotly' not in sys .modules
11
- assert ' numpy' not in sys .modules
12
- assert ' pandas' not in sys .modules
10
+ assert " plotly" not in sys .modules
11
+ assert " numpy" not in sys .modules
12
+ assert " pandas" not in sys .modules
13
13
14
14
import plotly .graph_objects as go
15
+
15
16
fig = go .Figure ().add_scatter (x = [0 ], y = [1 ])
16
17
fig .to_json ()
17
18
18
- assert ' plotly' in sys .modules
19
- assert ' numpy' not in sys .modules
20
- assert ' pandas' not in sys .modules
19
+ assert " plotly" in sys .modules
20
+ assert " numpy" not in sys .modules
21
+ assert " pandas" not in sys .modules
21
22
22
23
# check that numpy is installed
23
24
import numpy as np
25
+
24
26
fig = go .Figure ().add_scatter (x = np .array ([0 ]), y = np .array ([1 ]))
25
27
fig .to_json ()
26
- assert ' numpy' in sys .modules
27
- assert ' pandas' not in sys .modules
28
+ assert " numpy" in sys .modules
29
+ assert " pandas" not in sys .modules
28
30
29
31
# check that pandas is installed
30
32
import pandas as pd
33
+
31
34
fig = go .Figure ().add_scatter (x = pd .Series ([0 ]), y = pd .Series ([1 ]))
32
35
fig .to_json ()
33
- assert ' pandas' in sys .modules
36
+ assert " pandas" in sys .modules
0 commit comments