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

Do you need help?

ERRORE TEST HW4-REC

d
davide.cimmarrusti (170 points)
0 1 3
in HW4 by (170 points)
closed by
Quando faccio partire i test in Spyder mi esce questo errore:

Traceback (most recent call last):
  File "C:\Users\elisa\micromamba\envs\F22\lib\site-packages\ddt.py", line 220, in wrapper
    return func(self, *args, **kwargs)
  File "c:\users\elisa\downloads\hw4rec\hw4-rec\test_01.py", line 137, in test_print_top_students
    return self.do_test(f, params, expected, timeout, fout, fexp)
  File "c:\users\elisa\downloads\hw4rec\hw4-rec\test_01.py", line 45, in do_test
    self.check_text_file(fexpected, fout, ('The content of the file is incorrect\n'
  File "C:\Users\elisa\Downloads\HW4rec\HW4-rec\testlib.py", line 168, in check_text_file
    with open(b, encoding='utf8') as f: txt_b = f.read()
FileNotFoundError: [Errno 2] No such file or directory: 'test_pts1_l.txt'

Qualcuno ha avuto lo stesso problema ed è riuscito a risolvere?
419 views
closed with the note: risolto

2 Answers

andrea.sterbini (208020 points)
756 1270 2377
by (208k points)
Sei nella directory giusta? (nel campo in alto a destra di spyder)
d
davide.cimmarrusti (170 points)
0 1 3
by (170 points)
Sono nella cartella Hw4-rec,è questa?
andrea.sterbini (208020 points)
756 1270 2377
by (208k points)
Hai controllato che i file ci siano tutti? Magari ri-unzippa lo hw
d
davide.cimmarrusti (170 points)
0 1 3
by (170 points)
edited by
si ho provato a scaricare di nuovo l HW e ho sostituito il file con il codice ma nulla.Ora provo a disinstallare spyder magari è li il problema

Aggiornamento:ho installato tutto di nuovo ma ricevo sempre lo stesso errore
andrea.sterbini (208020 points)
756 1270 2377
by (208k points)
Se consegni posso dare una occhiata
d
davide.cimmarrusti (170 points)
0 1 3
by (170 points)
consegnato ieri sera,stamattina ho ricaricato.Grazie
andrea.sterbini (208020 points)
756 1270 2377
by (208k points)
I test si erano bloccati e li ho sbloccati.

Dal tuo log si vede che passi male la variabile fileout
d
davide.cimmarrusti (170 points)
0 1 3
by (170 points)
Va bene grazie mille
a
alex_andrei13 (3800 points)
15 41 53
by (3.8k points)

with open(b, encoding='utf8') as f: txt_b = f.read()

Non leggo il ‘r’ della lettura del file. Può essere?

andrea.sterbini (208020 points)
756 1270 2377
by (208k points)
mode='r' è il default