@@ -281,6 +281,10 @@ def check_output(self, want, got, optionflags):
281
281
platform.python_implementation()
282
282
)
283
283
284
+ # Mark that we are testing code (in this case, testing the documentation)
285
+ from pyomo.common.flags import in_testing_environment
286
+ in_testing_environment(True)
287
+
284
288
# We need multiprocessing because some doctests must be skipped if the
285
289
# start method is not "fork"
286
290
import multiprocessing
@@ -296,6 +300,9 @@ def check_output(self, want, got, optionflags):
296
300
)
297
301
from pyomo.contrib.parmest.parmest import parmest_available
298
302
303
+ # Ensure that the matplotlib import has been resolved (and the backend changed)
304
+ bool(matplotlib_available)
305
+
299
306
# Not using SolverFactory to check solver availability because
300
307
# as of June 2020 there is no way to suppress warnings when
301
308
# solvers are not available
@@ -326,10 +333,6 @@ def check_output(self, want, got, optionflags):
326
333
ma27_available = False
327
334
mumps_available = False
328
335
329
- # Mark that we are testing code (in this case, testing the documentation)
330
- from pyomo.common.flags import in_testing_environment
331
- in_testing_environment(True)
332
-
333
336
# Prevent any Pyomo logs from propagating up to the doctest logger
334
337
import logging
335
338
logging.getLogger('pyomo').propagate = False
0 commit comments