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

Do you need help?

Test 21B FAIL

DRDLCN (8070 points)
28 68 104
in Es2 by (8.1k points)
recategorized by
Ragazzi tutti i test 21b non passano ma ritornano un FAIL , non mi fa vedere (da console) cosa sbaglio....

C'è un comando che posso utilizzare? per analizzare meglio il test?
540 views

1 Answer

_andrea_ (45670 points)
13 42 297
by (45.7k points)
Ritorna solo fail e non dice altro?
DRDLCN (8070 points)
28 68 104
by (8.1k points)
trovo solo FAIL
DRDLCN (8070 points)
28 68 104
by (8.1k points)

edit:

test_21b_Skyline_aggiungi_3___s3______r1___30_____r1___70_____r1___110_____r1___150_____r2___40_____r2___80_____r2___120_____r2___160_____r3___50_____r3___90_____r3___130_____r3___170_____r4___60_____r4___10_____r4___140_____r4___180_____r5___70_____r5___20_____r5___150_____r5___190____2__4__4__0__4__250__120__14___es2_test21_3_png____es2_risTest21_3_png__ (__main__.Test)
list() -> new empty list ... 120 250
FAIL

R
RigelsHysaj (1550 points)
10 36 50
by (1.6k points)
anche a me lo stesso.
_andrea_ (45670 points)
13 42 297
by (45.7k points)
È strano perché se ho capito bene il test aggiungi non guarda cosa fai nel metodo aggiungi ma controlla solo che l'immagine che ne deriva sia corretta. Nel senso che dopo il metodo aggiungi viene richiamato salva, e da lì si verifica il risultato
_andrea_ (45670 points)
13 42 297
by (45.7k points)
Hai provato a caricare il program e a vedere cosa ti dice la macchina virtuale? Magari ti dà informazioni più dettagliate
r
rapiroma (440 points)
4 8 14
by (440 points)

Avete per caso risolto? Perché anche io ho lo stesso problema!

Ho provato a fare il debug del test ed ho ancora piu confusione di prima... 

Sembrerebbe che il test voglia aggiungere il rettangolo 'r2', che è verde, allo sfondo 's1', che è anch'esso verde.

test_02.py::Test::test_10b_Rettangolo_1___r1____rosso___50__50_ PASSED   [ 41%]
test_02.py::Test::test_10b_Rettangolo_2___r2____verde___70__90_ PASSED   [ 43%]
test_02.py::Test::test_10b_Rettangolo_3___r3____blu___20__70_ PASSED     [ 45%]
test_02.py::Test::test_10b_Rettangolo_4___r4____bianco___60__40_ PASSED  [ 47%]
test_02.py::Test::test_10b_Rettangolo_5___r5____nero___60__120_ PASSED   [ 49%]
test_02.py::Test::test_20a_Skyline_errata_1_10 PASSED                    [ 50%]
test_02.py::Test::test_20a_Skyline_errata_2_10_3 PASSED                  [ 52%]
test_02.py::Test::test_20a_Skyline_errata_3_colore PASSED                [ 54%]
test_02.py::Test::test_20a_Skyline_errata_4_None PASSED                  [ 56%]
test_02.py::Test::test_20b_Skyline_1___s1____verde__ PASSED              [ 58%]
test_02.py::Test::test_20b_Skyline_2___s2____rosso__ PASSED              [ 60%]
test_02.py::Test::test_20b_Skyline_3___s3____blu__ PASSED                [ 62%]
test_02.py::Test::test_21a_Skyline_aggiungi_errato_1___s1____r1____10_ PASSED [ 64%]
test_02.py::Test::test_21a_Skyline_aggiungi_errato_2___s1____r1___None_ PASSED [ 66%]
test_02.py::Test::test_21a_Skyline_aggiungi_errato_3___s2___None__20_ PASSED [ 68%]
test_02.py::Test::test_21a_Skyline_aggiungi_errato_4___s2____34__20_ PASSED [ 70%]
test_02.py::Test::test_21b_Skyline_aggiungi_1___s1______r1___10_____r2___90_____r3___180____0__1__0__1__0__200__70__2___es2_test21_1_png____es2_risTest21_1_png__ FAILED [ 72%]

ma restituisce un FAILED, che apparentemente è sbagliato viste le condizioni di verifica del metodo aggiungi che deve sollevare un'eccezione se il rettangolo ha lo stesso colore dello sfondo.

r
rapiroma (440 points)
4 8 14
by (440 points)
Alla fine, a forza di cercare nelle risposte alle altre domande, ho capito che dovevo togliere un Raise ValueError ed uscire con un return None!

Io invece ero convinto che andasse sollevata un'eccezione!