412554b2f06f3782c9336f5a4dfc5bb890219afd,pandas/tests/indexes/timedeltas/test_insert.py,TestTimedeltaIndexInsert,test_insert_invalid_na,#TestTimedeltaIndexInsert#,80

Before Change



    def test_insert_invalid_na(self):
        idx = TimedeltaIndex(["4day", "1day", "2day"], name="idx")
        msg = r"value should be a "Timedelta" or "NaT"\. Got "datetime64" instead\."
        with pytest.raises(TypeError, match=msg):
            idx.insert(0, np.datetime64("NaT"))

    @pytest.mark.parametrize(
        "item", [0, np.int64(0), np.float64(0), np.array(0), np.datetime64(456, "us")]
    )
    def test_insert_mismatched_types_raises(self, item):

After Change



        // FIXME: assert_index_equal fails if we pass a different
        //  instance of np.datetime64("NaT")
        item = np.datetime64("NaT")
        result = idx.insert(0, item)

        expected = Index([item] + list(idx), dtype=object, name="idx")
        tm.assert_index_equal(result, expected)

    @pytest.mark.parametrize(
        "item", [0, np.int64(0), np.float64(0), np.array(0), np.datetime64(456, "us")]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 11

Instances


Project Name: pandas-dev/pandas
Commit Name: 412554b2f06f3782c9336f5a4dfc5bb890219afd
Time: 2021-01-21
Author: jbrockmendel@gmail.com
File Name: pandas/tests/indexes/timedeltas/test_insert.py
Class Name: TestTimedeltaIndexInsert
Method Name: test_insert_invalid_na


Project Name: pandas-dev/pandas
Commit Name: f2ff676169c6f2aca04eebe22e5d31501f8a2a6b
Time: 2021-02-10
Author: jbrockmendel@gmail.com
File Name: pandas/tests/indexing/test_coercion.py
Class Name: TestWhereCoercion
Method Name: test_where_index_timedelta64


Project Name: pandas-dev/pandas
Commit Name: f2ff676169c6f2aca04eebe22e5d31501f8a2a6b
Time: 2021-02-10
Author: jbrockmendel@gmail.com
File Name: pandas/tests/indexes/timedeltas/test_indexing.py
Class Name: TestWhere
Method Name: test_where_mismatched_nat