本文整理匯總了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())