some new features

This commit is contained in:
ilgazca
2025-07-30 17:09:11 +03:00
parent db5d46760a
commit 8019bd3b7c
20616 changed files with 4375466 additions and 8 deletions

View File

@ -0,0 +1,25 @@
import subprocess
import sys
def test_lazy_imports():
# Check that when statsmodels.api is imported, matplotlib is _not_ imported
cmd = ("import statsmodels.api as sm; "
"import sys; "
"mods = [x for x in sys.modules if 'matplotlib.pyplot' in x]; "
"assert not mods, mods")
cmd = sys.executable + ' -c "' + cmd + '"'
p = subprocess.Popen(cmd, shell=True, close_fds=True)
p.wait()
rc = p.returncode
assert rc == 0
def test_docstring_optimization_compat():
# GH#5235 check that importing with stripped docstrings does not raise
cmd = sys.executable + ' -OO -c "import statsmodels.api as sm"'
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out = p.communicate()
rc = p.returncode
assert rc == 0, out