Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
97 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
|
||
.. _l-HISTORY: | ||
|
||
======= | ||
History | ||
======= | ||
|
||
current - 2018-03-31 - 0.00Mb | ||
current - 2018-04-21 - 0.00Mb | ||
============================= | ||
|
||
* `7`: talk about serialization (2018-04-20) | ||
* `5`: fix .. only:: html in readme.rst (2018-03-29) | ||
|
||
0.1.175 - 2017-10-05 - 0.02Mb | ||
0.1.175 - 2017-10-05 - 6.43Mb | ||
============================= | ||
|
||
* `2`: finish the migration of latex (2017-06-10) | ||
* `1`: completed completion (2016-09-25) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
_unittests/ut_documentation/test_run_notebooks_python_protobuf.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
@brief test log(time=67s) | ||
""" | ||
|
||
import sys | ||
import os | ||
import unittest | ||
|
||
|
||
try: | ||
import pyquickhelper as skip_ | ||
except ImportError: | ||
path = os.path.normpath( | ||
os.path.abspath( | ||
os.path.join( | ||
os.path.split(__file__)[0], | ||
"..", | ||
"..", | ||
"..", | ||
"pyquickhelper", | ||
"src"))) | ||
if path not in sys.path: | ||
sys.path.append(path) | ||
import pyquickhelper as skip_ | ||
|
||
|
||
try: | ||
import src | ||
except ImportError: | ||
path = os.path.normpath( | ||
os.path.abspath( | ||
os.path.join( | ||
os.path.split(__file__)[0], | ||
"..", | ||
".."))) | ||
if path not in sys.path: | ||
sys.path.append(path) | ||
import src | ||
|
||
from pyquickhelper.loghelper import fLOG | ||
from pyquickhelper.pycode import get_temp_folder, is_travis_or_appveyor | ||
from pyquickhelper.ipythonhelper import execute_notebook_list, execute_notebook_list_finalize_ut | ||
from pyquickhelper.ipythonhelper import install_python_kernel_for_unittest | ||
import src.teachpyx | ||
|
||
|
||
class TestRunNotebooksPythonProtobuf(unittest.TestCase): | ||
|
||
def test_run_notebook_python_protobuf(self): | ||
fLOG( | ||
__file__, | ||
self._testMethodName, | ||
OutputPrint=__name__ == "__main__") | ||
|
||
kernel_name = None if is_travis_or_appveyor() else install_python_kernel_for_unittest( | ||
"python3_module_template") | ||
|
||
temp = get_temp_folder(__file__, "temp_run_notebooks_python_protobuf") | ||
|
||
# selection of notebooks | ||
fnb = os.path.normpath(os.path.join( | ||
os.path.abspath(os.path.dirname(__file__)), "..", "..", "_doc", "notebooks", "python")) | ||
keepnote = [] | ||
for f in os.listdir(fnb): | ||
if os.path.splitext(f)[-1] == ".ipynb" and "protobuf" in f: | ||
keepnote.append(os.path.join(fnb, f)) | ||
|
||
# function to tell that a can be run | ||
def valid(cell): | ||
return True | ||
|
||
# additionnal path to add | ||
addpaths = [os.path.normpath(os.path.join( | ||
os.path.abspath(os.path.dirname(__file__)), "..", "..", "src")), | ||
os.path.normpath(os.path.join( | ||
os.path.abspath(os.path.dirname(__file__)), "..", "..", "..", "pyquickhelper", "src")), | ||
os.path.normpath(os.path.join( | ||
os.path.abspath(os.path.dirname(__file__)), "..", "..", "..", "jyquickhelper", "src")) | ||
] | ||
|
||
# run the notebooks | ||
res = execute_notebook_list( | ||
temp, keepnote, fLOG=fLOG, valid=valid, additional_path=addpaths, kernel_name=kernel_name) | ||
execute_notebook_list_finalize_ut( | ||
res, fLOG=fLOG, dump=src.teachpyx) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |