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

Do you need help?

Notice Board

Per partecipare al corso di Fondamenti di programmazione 2023-24 loggatevi e attivatelo nella vostra pagina dei corsi preferiti. A quel punto il corso appare nel menù personale cliccando sul proprio avatar. Per i materiali degli anni precedenti seguite lo stesso metodo.

To join the Programming/Lab 2023-24 course, log-on and select it on the my courses page. It will appear on the personal menu of your avatar. For earlier years use the same method.

Problema testing HW4

S
Savino.2140356 (5570 points)
1 2 16
in HW4 by (5.6k points)
closed by

Avevo consegnato una versione del programma che mi passava tutti i test tranne il test10, quindi ho caricato una versione migliorata del mio programma, ma ottengo questi errori:

=========================== short test summary info ============================
PASSED test_01.py==Test==test_intricacy
PASSED test_01.py==Test==test_no_globals_or_mutable_args
PASSED test_01.py==Test==test_untampered_types
FAILED test_01.py==Test==test01_example - FileExistsError= [Errno 17] File ex...
FAILED test_01.py==Test==test02_example - FileExistsError= [Errno 17] File ex...
FAILED test_01.py==Test==test03_example - FileExistsError= [Errno 17] File ex...
FAILED test_01.py==Test==test04_example - FileExistsError= [Errno 17] File ex...
FAILED test_01.py==Test==test05_example - FileExistsError= [Errno 17] File ex...
FAILED test_01.py==Test==test06_example - FileExistsError= [Errno 17] File ex...
FAILED test_01.py==Test==test07_example - FileExistsError= [Errno 17] File ex...
FAILED test_01.py==Test==test08_example - FileExistsError= [Errno 17] File ex...
FAILED test_01.py==Test==test09_example - FileExistsError= [Errno 17] File ex...
FAILED test_01.py==Test==test10_example - FileExistsError= [Errno 17] File ex...
FAILED test_01.py==Test==test_zz_top_types - FileExistsError= [Errno 17] File...
============ 11 failed, 3 passed, 10 deselected, 1 warning in 2.33s ============
MAX TEST TIME (174s) REACHED
ho provato a ricaricare la versione precedente del programma e ottengo lo stesso risultato, percui presumo che sia un problema della VM
349 views
closed

2 Answers

Best answer
andrea.sterbini (208020 points)
756 1270 2377
by (208k points)
selected by
Perchè apri il file in modalità esclusiva? se già esiste dal test precedente avrai errore!
s
sm15455 (400 points)
1 2 5
by (400 points)
Io passo mode='w' alla open. Anche a me ha funzionato per vari rilasci, poi oggi ha cominciato a dare questo problema.
s
sm15455 (400 points)
1 2 5
by (400 points)
Anche io ho lo stesso problema!
ale70029 (1950 points)
7 14 28
by (2.0k points)
la funzione os.makedirs ha un parametro che può essere modificato per non dare errore se la cartella esiste già