ciao a tutti, sono riuscito finalmente a risolvere il problema del homework trovando tutti i segreti ed ottendo la lista finale correttamente. L unico problema è che il test mi dice che la ricorsione non è presente nonostante la mia funzione non sia definita all interno di un altra funzione e io ottenga i segreti solo tramite questa funzione ricorsiva, comunque mi da questo errore cosa può essere?
'''
self = <test_01.Test testMethod=test_random_1_00001_esempio>, filename = 'esempio.txt', start = 'ROMA'
clues = 'la bocca sollevò dal fiero pasto'
expected = [['vendita diamanti rubati stanotte ad anversa', 'CANCUN'], ['vendita cannoni mercato nero del cairo', 'CANCUN'], ['furto di diamanti a buckingham palace', 'MILANO'], ['mata hari ha sedotto ambasciatore zambia', 'MILANO']]
@file_data("esempio.json")
def test_random_1(self, filename, start, clues, expected):
> return self.do_test(filename, start, clues, expected)
test_01.py:60:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_01.py:32: in do_test
program.ex1(filename, start_city, clues)
..\..\anaconda3\lib\contextlib.py:120: in __exit__
next(self.gen)
testlib.py:90: in assertIsRecursive
yield program
E AssertionError: RecursionDetectedError not raised'''
'''
self = <test_01.Test testMethod=test_random_1_00001_esempio>, filename = 'esempio.txt', start = 'ROMA'
clues = 'la bocca sollevò dal fiero pasto'
expected = [['vendita diamanti rubati stanotte ad anversa', 'CANCUN'], ['vendita cannoni mercato nero del cairo', 'CANCUN'], ['furto di diamanti a buckingham palace', 'MILANO'], ['mata hari ha sedotto ambasciatore zambia', 'MILANO']]
@file_data("esempio.json")
def test_random_1(self, filename, start, clues, expected):
> return self.do_test(filename, start, clues, expected)
test_01.py:60:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test_01.py:32: in do_test
program.ex1(filename, start_city, clues)
..\..\anaconda3\lib\contextlib.py:120: in __exit__
next(self.gen)
testlib.py:90: in assertIsRecursive
yield program
E AssertionError: RecursionDetectedError not raised'''