Skip to content

Commit bfa8416

Browse files
author
Baxter Eaves
committed
do not test plot module if NOPLOT
1 parent ad26a84 commit bfa8416

File tree

1 file changed

+10
-24
lines changed

1 file changed

+10
-24
lines changed

pylace/tests/test_docs.py

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
import polars as pl
66
from plotly import io
77

8-
HIDE_PLOT = os.environ.get("LACE_DOCTEST_NOPLOT", "0") == "1"
8+
NOPLOT = os.environ.get("LACE_DOCTEST_NOPLOT", "0") == "1"
99

1010

11-
if HIDE_PLOT:
12-
# io.renderers.default = 'json'
13-
io.renderers.default = "iframe"
11+
if NOPLOT:
12+
io.renderers.default = "json"
1413

1514

1615
pl.Config(tbl_rows=8)
@@ -24,28 +23,15 @@ def copy(self):
2423
return self
2524

2625

27-
def plot():
28-
module = import_module("lace.plot")
26+
def runtest(mod):
27+
module = import_module(mod)
2928
extraglobs = _Context(module.__dict__.copy())
30-
31-
doctest.testmod(module, extraglobs=extraglobs)
32-
33-
34-
def engine():
35-
module = import_module("lace.engine")
36-
extraglobs = _Context(module.__dict__.copy())
37-
38-
doctest.testmod(module, extraglobs=extraglobs)
39-
40-
41-
def analysis():
42-
module = import_module("lace.analysis")
43-
extraglobs = _Context(module.__dict__.copy())
44-
4529
doctest.testmod(module, extraglobs=extraglobs)
4630

4731

4832
if __name__ == "__main__":
49-
engine()
50-
analysis()
51-
plot()
33+
runtest("lace.engine")
34+
runtest("lace.analysis")
35+
36+
if not NOPLOT:
37+
runtest("lace.plot")

0 commit comments

Comments
 (0)