Skip to content

Commit b34c54d

Browse files
committed
Improve coverage a bit.
1 parent 48940bf commit b34c54d

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

patsy/contrasts.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,11 @@ def test_Poly():
321321
[1, 0.293294230042706, -0.762000762001143],
322322
[1, 0.513264902574736, 0.635000635000952]])
323323

324+
from nose.tools import assert_raises
325+
assert_raises(PatsyError,
326+
Poly(scores=[0, 1]).code_with_intercept,
327+
["a", "b", "c"])
328+
324329
matrix = t1.code_with_intercept(list(range(6)))
325330
assert matrix.column_suffixes == [".Constant", ".Linear", ".Quadratic",
326331
".Cubic", "^4", "^5"]

patsy/design_info.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,9 @@ def test_DesignInfo_from_array():
707707
di_weird = DesignInfo.from_array(m)
708708
assert di_weird.column_names == ["column0"]
709709

710+
from nose.tools import assert_raises
711+
assert_raises(ValueError, DesignInfo.from_array, np.ones((2, 2, 2)))
712+
710713
from patsy.util import have_pandas
711714
if have_pandas:
712715
import pandas

0 commit comments

Comments
 (0)