From fb2127422317ed2ed5dbc164be88dfc2cb243edd Mon Sep 17 00:00:00 2001 From: Javi Merino Date: Tue, 8 Mar 2016 11:55:23 +0000 Subject: tests: fix test_filter_prev_values expected result pandas 0.17.1 has a more accurate assert_series_equal() that makes test_filter_prev_values fail because the index name is different: ====================================================================== FAIL: Trigger works with a filter that depends on previous values of the same pivot ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/javi/src/trappy/tests/test_stats.py", line 227, in test_filter_prev_values assert_series_equal(expected, trigger.generate("blank")) File "/usr/lib/python2.7/dist-packages/pandas/util/testing.py", line 924, in assert_series_equal obj='{0}.index'.format(obj)) File "/usr/lib/python2.7/dist-packages/pandas/util/testing.py", line 694, in assert_index_equal assert_attr_equal('names', left, right, obj=obj) File "/usr/lib/python2.7/dist-packages/pandas/util/testing.py", line 729, in assert_attr_equal left_attr, right_attr) File "/usr/lib/python2.7/dist-packages/pandas/util/testing.py", line 819, in raise_assert_detail raise AssertionError(msg) AssertionError: Series.index are different Attribute "names" are different [left]: [u'Time'] [right]: [None] ---------------------------------------------------------------------- The series that trigger generates don't have a name for the index. Remove the named index from the expected output so that the test passes again. --- tests/test_stats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test_stats.py b/tests/test_stats.py index 7d96315..893c490 100644 --- a/tests/test_stats.py +++ b/tests/test_stats.py @@ -223,7 +223,7 @@ class TestTrigger(BaseTestStats): filters={"identifier": my_filter(1)}, value=-1, pivot="result") - expected = pd.Series([-1, -1], index=pd.Index([0.3, 0.6], name="Time")) + expected = pd.Series([-1, -1], index=[0.3, 0.6]) assert_series_equal(expected, trigger.generate("blank")) -- cgit v1.2.3