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 .