Skip to content

Commit

Permalink
do not test plot module if NOPLOT
Browse files Browse the repository at this point in the history
  • Loading branch information
Baxter Eaves committed Jan 25, 2024
1 parent ad26a84 commit bfa8416
Showing 1 changed file with 10 additions and 24 deletions.
34 changes: 10 additions & 24 deletions pylace/tests/test_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
import polars as pl
from plotly import io

HIDE_PLOT = os.environ.get("LACE_DOCTEST_NOPLOT", "0") == "1"
NOPLOT = os.environ.get("LACE_DOCTEST_NOPLOT", "0") == "1"


if HIDE_PLOT:
# io.renderers.default = 'json'
io.renderers.default = "iframe"
if NOPLOT:
io.renderers.default = "json"


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


def plot():
module = import_module("lace.plot")
def runtest(mod):
module = import_module(mod)
extraglobs = _Context(module.__dict__.copy())

doctest.testmod(module, extraglobs=extraglobs)


def engine():
module = import_module("lace.engine")
extraglobs = _Context(module.__dict__.copy())

doctest.testmod(module, extraglobs=extraglobs)


def analysis():
module = import_module("lace.analysis")
extraglobs = _Context(module.__dict__.copy())

doctest.testmod(module, extraglobs=extraglobs)


if __name__ == "__main__":
engine()
analysis()
plot()
runtest("lace.engine")
runtest("lace.analysis")

if not NOPLOT:
runtest("lace.plot")

0 comments on commit bfa8416

Please sign in to comment.