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.

HW4 problemi con pytest test_01.py -v -rA --profile

2
2045982 (680 points)
0 4 7
in Avvisi by (680 points)

Dopo aver sottoposto l'HW4 con il comando pytest test_01.py -v -rA i test vengono superati con successo. Provando invece, come suggerito nelle istruzioni, a "stampare i test nelle 20 funzioni complessivamente più lente" tramite il comando pytest test_01.py -v -rA --profile viene prodotto un errore.


Nome del test di errore:

test_01.py::Test::test_single_10___test11_metonymies_txt____ᛃᚬᛝᚸᛈᚦᚱᛦᛢᛮᚼᛋᚯᛤᚳᛈᛓᚿᛊᚬᛈᚯᛎᚦᛅᛮᚧᚬᛦᚲᚮᚶᛑきᛓᛔᛮぞᛘᚼᛤᚩᛮᚼᛋᛛᛡᚱᛌᛑᚩᛪきᛤᛃᛅᛞᛏᛣᚤᚻᚦᚢᚩᛨᛐᛘゔᚷᚴᚧᚺᛖᛑᛨᛈがᛃᛥᚽᛚᚣᛋᚾᚳᚩごばᚩᚰぐがたᚨᚼᚩᛉ_ᛅᚬᚲぅしᛪᚵᚨぎᛝᛡᛀごでᛟᚸゖそぇが__じゔᚫぴ___ᛆᛪᚯ_ᚤᛑᚺᚾᛒᛦにぼ_ぞゃせねねな__ FAILED [ 85%]


Testo di errore che viene prodotto:

INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\main.py", line 268, in wrap_session      
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\main.py", line 322, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80, in _hookexec       
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 60, in _multicall      
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_result.py", line 60, in get_result       
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 39, in _multicall      
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\_pytest\main.py", line 347, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_hooks.py", line 265, in __call__
INTERNALERROR>     return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
INTERNALERROR>   File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\pluggy\_callers.py", line 55, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\pytest_profiling.py", line 80, in pytest_runtest_protocol
INTERNALERROR>     prof.dump_stats(prof_filename)
INTERNALERROR>   File "C:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\cProfile.py", line 46, in dump_stats
INTERNALERROR>     with open(file, 'wb') as f:
INTERNALERROR> FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\ASUS\\OneDrive\\Desktop\\Lorenzo\\Python\\HW\\HW4req\\HW4-req\\prof\\test_single_10___test11_metonymies_txt________________________________________________________________________________________________________________________________________________________.prof'


Ricordo che in tutti gli altri casi i test funzionano correttamente, pertanto ho ipotizzato che il problema fosse solo in questo specifico caso .

354 views

1 Answer

f
ffranc.pagliaccia (470 points)
0 2 5
by (470 points)
Dall'errore sembrerebbe non trovarti il file txt richiesto per iniziare il test. prova a vedere nella cartella 11 se il file metonymies.txt esiste senno riscaricalo.
d
danyspadea (4330 points)
1 4 25
by (4.3k points)
no, penso sia un errore di un altro tipo. anche a me succede uguale se runno il test col profiler dal prompt, ma in tutti gli altri casi va senza problemi, il file metonymies.txt c'è infatti.