Permalink
Browse files

addition to find a bug in a unit test

  • Loading branch information...
sdpython committed Feb 21, 2017
1 parent 323cabb commit 786e44fa08c19821efbce4a54ebe69707acf6488
@@ -15,4 +15,4 @@
ont découvert et qui est fabuleux... On sait faire. Montrer le plaisir
qu'on a de s'égarer sur le chemin d'une découverte... On sait moins faire.
Les mathématiques sont une des rares sciences pour laquelle on nous raconte toujours
la conclusion d'une histoire, jamais l'histoire.
la conclusion d'une histoire, jamais l'histoire.
@@ -37,7 +37,7 @@
sys.path.append(path)
import pyquickhelper as skip_
from pyquickhelper.loghelper import fLOG
from pyquickhelper.loghelper import fLOG, CustomLog
from pyquickhelper.pycode import get_temp_folder, fix_tkinter_issues_virtualenv
from src.code_beatrix.algorithm.data import load_prenoms_w
from src.code_beatrix.algorithm.classroom import random_positions, plot_positions, optimize_positions, find_best_positions_greedy, measure_positions
@@ -60,21 +60,36 @@ def test_random_position(self):
self._testMethodName,
OutputPrint=__name__ == "__main__")
temp = get_temp_folder(__file__, "temp_random_position")
clog = CustomLog(temp)
clog("random_positions")
fLOG("random_positions")
positions = random_positions(24)
self.assertEqual(len(positions), 24)
temp = get_temp_folder(__file__, "temp_random_position")
clog("beginning")
fLOG("beginning")
fix_tkinter_issues_virtualenv()
clog("fix")
fLOG("fix")
import matplotlib.pyplot as plt
clog("plotting")
fLOG("plotting")
fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(8, 8))
clog("plotting positions")
fLOG("plotting positions")
plot_positions(positions, ax=ax)
assert ax is not None
clog("savefig")
img = os.path.join(temp, "img.png")
fig.savefig(img)
assert os.path.exists(img)
clog("noshow")
if __name__ == "__main__":
fig.show()
clog("close")
plt.close('all')
clog("end")
fLOG("end")
def test_find_greedy(self):

0 comments on commit 786e44f

Please sign in to comment.