test_utils.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:cohorts 作者: hammerlab 项目源码 文件源码
def test_as_dataframe_bad_rename():
    df_hello, cohort = prep_test_cohort()
    # test behavior with rename_cols=True. should raise a warning
    with warnings.catch_warnings(record=True) as w:
        warnings.simplefilter("always")
        df = cohort.as_dataframe(rename_cols=True, join_with='hello')
        # skip test since warnings (for some reason) don't propagate
        #ok_(len(w) > 0, 'fail to generate dups warning when using rename_cols=True')
    res = compare_column_names(expected = df_hello.columns,
                               observed = df.columns)
    ok_(res, 'columns names failed to match expected')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号