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.

HW2req non parte il test

a
andrea_B25 (260 points)
1 3 5
in HW2 obbligatorio by (260 points)
recategorized by

ciao a tutti,

attualmente  ho installata la versione 3.8.3 di python  e  uso spyder4

sto cercando  di fare i test per HW obbligatorio ma  quando vado sul prompt anaconda mi restituisce il seguente errore:

(base) PS C:\Users\Utente\desktop\HW2req> pytest test_01.py -v -rA
================================================= test session starts =================================================
platform win32 -- Python 3.8.3, pytest-5.4.3, py-1.9.0, pluggy-0.13.1 -- C:\Users\Utente\anaconda3\python.exe
cachedir: .pytest_cache
rootdir: C:\Users\Utente\Desktop\HW2req
collected 0 items / 1 error

======================================================= ERRORS ========================================================
_____________________________________________ ERROR collecting test_01.py _____________________________________________
ImportError while importing test module 'C:\Users\Utente\Desktop\HW2req\test_01.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
test_01.py:1: in <module>
    import testlib
testlib.py:2: in <module>
    import stopit
E   ModuleNotFoundError: No module named 'stopit'
=============================================== short test summary info ===============================================
ERROR test_01.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
================================================== 1 error in 0.12s ===================================================
(base) PS C:\Users\Utente\desktop\HW2req>

 ho provato a modificare il file Testlib come indicato da altri ma la situazione non cambia..

ho modificato la riga di testlib in questo modo:

print(f"Importing {name} (globals, locals, {fromlist}, {level}) (not allowed)")

Sapete  come risolverlo? 

334 views

3 Answers

andrea.sterbini (207920 points)
749 1267 2373
by (208k points)

angry INSTALLATE STOPIT!!!!! angry

1946981 (3070 points)
5 15 35
by (3.1k points)
Credo tu non abbia scaricato la libreria stopit perché dice no module named 'stopit' found
9
9Andrea9 (12340 points)
12 32 56
by (12.3k points)
a destra della pagina puoi trovare la voce  "SOFTWARE DA INSTALLARE" quelli in rosso sono essenziali, per scaricarli dovrai prendere il codice presente nella terza colonna