Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
split unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Oct 14, 2018
1 parent 6155949 commit 6af2f8d
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 4 deletions.
8 changes: 4 additions & 4 deletions _unittests/ut_dnotebooks/test_2A_notebook_eleves_2018.py
@@ -1,5 +1,5 @@
"""
@brief test log(time=40s)
@brief test log(time=20s)
"""

import sys
Expand All @@ -23,7 +23,7 @@
import src


class TestNotebookEleves2018(unittest.TestCase):
class TestNotebookEleves201809(unittest.TestCase):

def setUp(self):
add_missing_development_version(["pymyinstall", "pyensae", "pymmails", "jyquickhelper"],
Expand All @@ -33,7 +33,7 @@ def get_replacements(self):
return {"https://archive.ics.uci.edu/ml/machine-learning-databases/00222/":
"http://www.xavierdupre.fr/enseignement/complements/"}

def test_notebook_runner_eleves(self):
def test_notebook_runner_eleves_201809(self):
fLOG(
__file__,
self._testMethodName,
Expand All @@ -51,7 +51,7 @@ def valid_cell(cell):
return False
return True

a_test_notebook_runner(__file__, "", exe, fLOG=fLOG, valid=valid_cell,
a_test_notebook_runner(__file__, "2018-09", exe, fLOG=fLOG, valid=valid_cell,
copy_files=copy_files, modules=[src.ensae_teaching_cs])


Expand Down
59 changes: 59 additions & 0 deletions _unittests/ut_dnotebooks/test_2A_notebook_eleves_201810.py
@@ -0,0 +1,59 @@
"""
@brief test log(time=31s)
"""

import sys
import os
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import add_missing_development_version


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


class TestNotebookEleves201810(unittest.TestCase):

def setUp(self):
add_missing_development_version(["pymyinstall", "pyensae", "pymmails", "jyquickhelper"],
__file__, hide=True)

def get_replacements(self):
return {"https://archive.ics.uci.edu/ml/machine-learning-databases/00222/":
"http://www.xavierdupre.fr/enseignement/complements/"}

def test_notebook_runner_eleves_201810(self):
fLOG(
__file__,
self._testMethodName,
OutputPrint=__name__ == "__main__")
from src.ensae_teaching_cs.automation.notebook_test_helper import a_test_notebook_runner
copy_files = [os.path.join("titanic.csv", "titanic.csv")]
exe = os.path.join("notebook_eleves", "2018-2019")

def valid_cell(cell):
if "nuplet[1] = 5" in cell:
return False
if cell == "dico[0]":
return False
if cell == "dico[ [4,6] ] = 6":
return False
return True

a_test_notebook_runner(__file__, "2018-10", exe, fLOG=fLOG, valid=valid_cell,
copy_files=copy_files, modules=[src.ensae_teaching_cs])


if __name__ == "__main__":
unittest.main()

0 comments on commit 6af2f8d

Please sign in to comment.