Sto facendo esercizi presenti nell'eserciziario, in questo caso all'es 7 ho definito la funzione recursivamente, ma annidata in if e cicli for; Anaconda prompt, al comando di test, restituisce: [parte iniziale del percorso censurata]
Fondamenti di Programmazione Python\Esercizi\Esercizi esame\Lvl 3\7\test.py", line 68, in test_2
return self.do_test(lista2, {1,2,3,5,9}, 2, 3)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Fondamenti di Programmazione Python\Esercizi\Esercizi esame\Lvl 3\7\test.py", line 21, in do_test
raise Exception("Recursion not present")
Exception: Recursion not present
======================================================================
ERROR: test_3 (__main__.Test.test_3)
Terzo test della funzione es1 con insieme= {12,21,29,30,81,94}, k= 1 e albero:
----------------------------------------------------------------------
Traceback (most recent call last):
Fondamenti di Programmazione Python\Esercizi\Esercizi esame\Lvl 3\7\test.py", line 98, in test_3
return self.do_test(lista3, {12,21,29,30,81,94}, 1, 4)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Fondamenti di Programmazione Python\Esercizi\Esercizi esame\Lvl 3\7\test.py", line 21, in do_test
raise Exception("Recursion not present")
Exception: Recursion not present
----------------------------------------------------------------------
Ran 3 tests in 0.002s
FAILED (errors=3)
3 test passed, 0 tests failed
Perchè dice che ho passato i test, ma riporta fallito ? Perchè non rileva la ricorsione e come potrei fixarla ?
Edit: ciò accade anche per altri esercizi
Fondamenti di Programmazione Python\Esercizi\Esercizi esame\Lvl 3\7\test.py", line 68, in test_2
return self.do_test(lista2, {1,2,3,5,9}, 2, 3)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Fondamenti di Programmazione Python\Esercizi\Esercizi esame\Lvl 3\7\test.py", line 21, in do_test
raise Exception("Recursion not present")
Exception: Recursion not present
======================================================================
ERROR: test_3 (__main__.Test.test_3)
Terzo test della funzione es1 con insieme= {12,21,29,30,81,94}, k= 1 e albero:
----------------------------------------------------------------------
Traceback (most recent call last):
Fondamenti di Programmazione Python\Esercizi\Esercizi esame\Lvl 3\7\test.py", line 98, in test_3
return self.do_test(lista3, {12,21,29,30,81,94}, 1, 4)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Fondamenti di Programmazione Python\Esercizi\Esercizi esame\Lvl 3\7\test.py", line 21, in do_test
raise Exception("Recursion not present")
Exception: Recursion not present
----------------------------------------------------------------------
Ran 3 tests in 0.002s
FAILED (errors=3)
3 test passed, 0 tests failed
Perchè dice che ho passato i test, ma riporta fallito ? Perchè non rileva la ricorsione e come potrei fixarla ?
Edit: ciò accade anche per altri esercizi