import cellprofiler.preferences as cpprefs
cpprefs.set_headless()
import wx
for s in dir(wx):
del wx.__dict__[s]
if "--nojavatests" in sys.argv:
sys.argv.remove("--nojavatests")
import cellprofiler.utilities.jutil as jutil
jutil.start_vm = None
After Change
sys.argv.remove("--noguitests")
import cellprofiler.preferences as cpprefs
cpprefs.set_headless()
sys.modules["wx"] = None
if "--nojavatests" in sys.argv:
sys.argv.remove("--nojavatests")
import cellprofiler.utilities.jutil as jutil