Please ignore secret bonuses. Secret tests do NOT award bonus. Max hw grade is 30+2 bonus efficiency

Do you need help?

HW2bis esercizio 1

F
Francesca (160 points)
0 2 3
in HW2bis by (160 points)
recategorized by

l'esercizio 1 del HW2bis, se faccio i test da spyder mi funzionano, mentre se provo da anaconda prompt, ottengo i seguenti errori.

in particolare sembra che io stia usando un qualche valore che non risulta un intero.

c'è qualcuno che può aiutarmi a capire dove sbaglio?.

grazie

test_01.py::Test::test_fseq6_100righe_da_20_e_spazi FAILED               [ 83%]

test_01.py::Test::test_fseq7_5000righe_da_6_e_spazi

================================== FAILURES ===================================

_____________________ Test.test_fseq1_sequenze_di_esempio _____________________

self = <test_01.Test testMethod=test_fseq1_sequenze_di_esempio>

    def test_fseq1_sequenze_di_esempio(self):

>       return self.do_test('es1_fseq1.txt', 'es1_fseq1b.txt', 'es1_RisSeq1.txt', 3)

test_01.py:29:

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

test_01.py:24: in do_test

    self.assertEqual(type(result), int,       "il risultato non e' unintero")

E   AssertionError: <class 'NoneType'> != <class 'int'> : il risultato non e' unintero

________________________ Test.test_fseq2_10righe_da_4 _________________________

self = <test_01.Test testMethod=test_fseq2_10righe_da_4>

    def test_fseq2_10righe_da_4(self):

>       return self.do_test('es1_fseq2.txt', 'es1_fseq2b.txt', 'es1_RisSeq2.txt', 8)

test_01.py:32:

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

test_01.py:24: in do_test

    self.assertEqual(type(result), int,       "il risultato non e' unintero")

E   AssertionError: <class 'NoneType'> != <class 'int'> : il risultato non e' unintero

_______________________ Test.test_fseq3_100righe_da_20 ________________________

263 views

1 Answer

andrea.sterbini (207940 points)
756 1270 2377
by (208k points)
Mi sembra che tu non ritorni il valore intero per cui il test riceve None e fallisce
F
Francesca (160 points)
0 2 3
by (160 points)
si grazie mille.

me ne sono accorta qualche momento dopo che ho mandato la domanda.

ora funziona anche in anaconda prompt.