本文整理汇总了Python中src.ensae_teaching_cs.automation.notebook_test_helper.ls_notebooks函数的典型用法代码示例。如果您正苦于以下问题:Python ls_notebooks函数的具体用法?Python ls_notebooks怎么用?Python ls_notebooks使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ls_notebooks函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_notebook_runner_2a_long
def test_notebook_runner_2a_long(self):
fLOG(
__file__,
self._testMethodName,
OutputPrint=__name__ == "__main__")
if "travis" in sys.executable:
# skip travis and R
warnings.warn(
"travis, unable to test TestNotebookRunner2a_long.test_notebook_runner_2a_long")
return
if "R_HOME" not in os.environ or not os.path.exists(os.environ["R_HOME"]):
paths = [r"C:\Program Files\R\R-3.2.2",
r"C:\Program Files\R\R-3.1.2"]
for path in paths:
if os.path.exists(path):
os.environ["R_HOME"] = path
break
temp = get_temp_folder(__file__, "temp_notebook2a_long_")
keepnote = ls_notebooks("2a")
assert len(keepnote) > 0
res = execute_notebooks(temp, keepnote,
lambda i, n: "python_r" in n,
fLOG=fLOG,
clean_function=clean_function_1a)
unittest_raise_exception_notebook(res, fLOG)
示例2: test_notebook_runner
def test_notebook_runner(self):
fLOG(__file__, self._testMethodName, OutputPrint=__name__ == "__main__")
temp = get_temp_folder(__file__, "temp_notebook2a_1")
keepnote = ls_notebooks("td2a")
assert len(keepnote) > 0
res = execute_notebooks(temp, keepnote, lambda i, n: "_1" in n, fLOG=fLOG)
unittest_raise_exception_notebook(res, fLOG)
示例3: test_notebook_runner_exams
def test_notebook_runner_exams(self):
fLOG(
__file__,
self._testMethodName,
OutputPrint=__name__ == "__main__")
temp = get_temp_folder(__file__, "temp_notebookexams_")
keepnote = ls_notebooks("exams")
assert len(keepnote) > 0
res = execute_notebooks(temp, keepnote,
lambda i, n: "git" not in n and "interro_rapide_20_minutes_2014_11" not in n,
fLOG=fLOG,
clean_function=clean_function_1a)
unittest_raise_exception_notebook(res, fLOG)
示例4: test_notebook_runner_1a
def test_notebook_runner_1a(self):
fLOG(
__file__,
self._testMethodName,
OutputPrint=__name__ == "__main__")
temp = get_temp_folder(__file__, "temp_notebook1a_")
keepnote = ls_notebooks("1a")
assert len(keepnote) > 0
res = execute_notebooks(temp, keepnote,
lambda i, n: "deviner" not in n,
fLOG=fLOG,
clean_function=clean_function_1a)
unittest_raise_exception_notebook(res, fLOG)
示例5: test_notebook_runner_correction_11
def test_notebook_runner_correction_11(self):
fLOG(
__file__,
self._testMethodName,
OutputPrint=__name__ == "__main__")
temp = get_temp_folder(__file__, "temp_notebook1a_correction_11")
keepnote = ls_notebooks("td1a")
assert len(keepnote) > 0
res = execute_notebooks(temp, keepnote,
lambda i, n: "correction_session_11" in n,
fLOG=fLOG,
clean_function=TestNotebookRunner1a_correction_11.clean_function)
unittest_raise_exception_notebook(res, fLOG)
示例6: test_notebook_runner_exposelong3
def test_notebook_runner_exposelong3(self):
fLOG(
__file__,
self._testMethodName,
OutputPrint=__name__ == "__main__")
temp = get_temp_folder(__file__, "temp_notebookexposelong3_")
keepnote = ls_notebooks("expose")
assert len(keepnote) > 0
res = execute_notebooks(temp, keepnote,
lambda i, n: "mortalite" in n,
fLOG=fLOG,
deepfLOG=fLOG if __name__ == "__main__" else noLOG,
clean_function=clean_function_1a)
unittest_raise_exception_notebook(res, fLOG)
示例7: test_notebook_runner_expose1
def test_notebook_runner_expose1(self):
fLOG(
__file__,
self._testMethodName,
OutputPrint=__name__ == "__main__")
temp = get_temp_folder(__file__, "temp_notebookexpose1_")
keepnote = ls_notebooks("expose")
assert len(keepnote) > 0
res = execute_notebooks(temp, keepnote,
lambda i, n: "velib" not in n and "paris_parcours" not in n
and "ml_table_mortalite" not in n,
fLOG=fLOG,
clean_function=clean_function_1a)
unittest_raise_exception_notebook(res, fLOG)
示例8: test_notebook_runner_2a
def test_notebook_runner_2a(self):
fLOG(
__file__,
self._testMethodName,
OutputPrint=__name__ == "__main__")
if "travis" in sys.executable:
# skip C# on linux
warnings.warn(
"travis, unable to test TestNotebookRunner2a_csharp.test_notebook_runner_2a")
return
if not sys.platform.startswith("win"):
return
temp = get_temp_folder(__file__, "temp_notebook2a_sharp")
keepnote = ls_notebooks("2a")
assert len(keepnote) > 0
res = execute_notebooks(temp, keepnote,
lambda i, n: "csharp" in n,
fLOG=fLOG,
clean_function=clean_function_1a)
assert len(res) > 0
fails = [(os.path.split(k)[-1], v)
for k, v in sorted(res.items()) if not v[0]]
for f in fails:
fLOG(f)
if len(fails) > 0:
e = str(fails[0][1][-1])
if "Audio device error encountered" in str(e):
# maybe the script is running on a virtual machine (no Audia
# device)
if os.environ["USERNAME"] == "ensaestudent" or \
os.environ["USERNAME"] == "vsxavierdupre" or \
"paris" in os.environ["COMPUTERNAME"].lower() or \
os.environ["USERNAME"].endswith("$"): # anonymous Jenkins configuration
# I would prefer to catch a proper exception
# it just exclude one user only used on remotre machines
fLOG("no audio")
return
elif "<class 'int'>-" in str(e):
# issue with conversion from 3 to double
return
fLOG(str(e).replace("\n", " EOL "))
raise fails[0][1][-1]
else:
fLOG("success")
示例9: test_notebook_runner_enonce_1_7
def test_notebook_runner_enonce_1_7(self):
fLOG(
__file__,
self._testMethodName,
OutputPrint=__name__ == "__main__")
temp = get_temp_folder(__file__, "temp_notebook1a_enonce_1_7")
keepnote = ls_notebooks("td1a")
assert len(keepnote) > 0
res = execute_notebooks(temp, keepnote,
lambda i, n: "_12" not in n
and "cenonce_session1." not in n
and "cenonce_session6." not in n
and "cenonce_session8." not in n
and "cenonce_session9." not in n
and "cenonce_session_10." not in n
and "cenonce_session_11." not in n
and "enonce" in n,
fLOG=fLOG,
clean_function=clean_function_1a)
unittest_raise_exception_notebook(res, fLOG)