Skip to content

Commit a7ab153

Browse files
committed
Merge pull request #583 from zploskey/testfixes
Fix some tests/examples for python 3 or if missing statsmodels
2 parents 9b89ba8 + eb6d85d commit a7ab153

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

pymc/examples/glm_linear.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
from __future__ import print_function
2+
13
import numpy as np
4+
import sys
25

36
try:
47
import statsmodels.api as sm

pymc/examples/glm_robust.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
from __future__ import print_function
2+
13
import numpy as np
4+
import sys
25

36
try:
47
import statsmodels.api as sm
58
except ImportError:
9+
print("Example requires statsmodels")
610
sys.exit(0)
711

812
from pymc import *

pymc/tests/test_glm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
try:
77
import statsmodels.api as sm
88
except ImportError:
9-
sys.exit(0)
9+
raise SkipTest("Test requires statsmodels.")
1010

1111
from pymc.examples import glm_linear, glm_robust
1212

0 commit comments

Comments
 (0)