本文整理汇总了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())