當前位置: 首頁>>代碼示例>>Python>>正文


Python nose.with_setup方法代碼示例

本文整理匯總了Python中nose.with_setup方法的典型用法代碼示例。如果您正苦於以下問題:Python nose.with_setup方法的具體用法?Python nose.with_setup怎麽用?Python nose.with_setup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在nose的用法示例。


在下文中一共展示了nose.with_setup方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_csv_2_temp_table_task

# 需要導入模塊: import nose [as 別名]
# 或者: from nose import with_setup [as 別名]
def test_csv_2_temp_table_task():
    '''
    CSV to temp table task should run and generate no entry in OBSTable, but
    a physical table in the right schema.
    '''
    task = TestCSV2TempTableTask()
    before_table_count = current_session().execute(
        'SELECT COUNT(*) FROM observatory.obs_table').fetchone()[0]
    runtask(task)
    table = task.output()
    assert_equal(current_session().execute(
        'SELECT COUNT(*) FROM {}'.format(
            table.table)).fetchone()[0], 10)
    after_table_count = current_session().execute(
        'SELECT COUNT(*) FROM observatory.obs_table').fetchone()[0]
    assert_equal(before_table_count, after_table_count)


# This test is disabled because RepoFileUnzipTask extends RepoFileUncompressTask,
# which uses `yield` inside `run` for a dynamic dependency. Dynamic
# dependencies are not supported by our task runner.
# @with_setup(setup, teardown)
# def test_download_unzip_task():
#     '''
#     Download unzip task should download remote assets and unzip them locally.
#     '''
#     task = TestRepoFileUnzipTask()
#     if task.output().exists():
#         shell('rm -r {}'.format(task.output().path))
#     assert_false(task.output().exists())
#     runtask(task)
#     assert_true(task.output().exists()) 
開發者ID:CartoDB,項目名稱:bigmetadata,代碼行數:34,代碼來源:test_tabletasks.py


注:本文中的nose.with_setup方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。