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.

Mi da questo errore quando provo i test nel prompt. Su spider ovviamente funziona.

Hatlas (5340 points)
1 2 7
in HW2 obbligatorio by (5.3k points)
closed by

FAILED test_01.py::Test::test_example - testlib.ForbiddenError: The import of 'unicodedata' is forbidden
FAILED test_01.py::Test::test_json1_00001_test_200_4_eng - testlib.ForbiddenError: The import of 'unicodedata' is forbidden
FAILED test_01.py::Test::test_json1_00002_test_400_5_ita - testlib.ForbiddenError: The import of 'unicodedata' is forbidden
FAILED test_01.py::Test::test_json1_00003_test_600_6_eng - testlib.ForbiddenError: The import of 'unicodedata' is forbidden
FAILED test_01.py::Test::test_json1_00004_test_800_7_ita - testlib.ForbiddenError: The import of 'unicodedata' is forbidden
FAILED test_01.py::Test::test_json1_00005_test_1000_8_eng - testlib.ForbiddenError: The import of 'unicodedata' is forbidden
FAILED test_01.py::Test::test_json1_00006_test_1200_9_ita - testlib.ForbiddenError: The import of 'unicodedata' is forbidden
FAILED test_01.py::Test::test_json1_00007_test_1400_10_eng - testlib.ForbiddenError: The import of 'unicodedata' is forbidden
FAILED test_01.py::Test::test_json1_00008_test_1600_11_ita - testlib.ForbiddenError: The import of 'unicodedata' is forbidden
FAILED test_01.py::Test::test_json1_00009_test_2000_12_eng - testlib.ForbiddenError: The import of 'unicodedata' is forbidden
FAILED test_01.py::Test::test_json1_00010_test_10000_10_eng - testlib.ForbiddenError: The import of 'unicodedata' is forbidden
FAILED test_01.py::Test::test_json2_00001_test_100000_12_eng - testlib.ForbiddenError: The import of 'unicodedata' is forbidden
FAILED test_01.py::Test::test_json2_00002_test_100000_12_ita - testlib.ForbiddenError: The import of 'unicodedata' is forbidden
FAILED test_01.py::Test::test_json3_00001_test_500000_15_eng - testlib.ForbiddenError: The import of 'unicodedata' is forbidden
FAILED test_01.py::Test::test_json3_00002_test_500000_15_ita - testlib.ForbiddenError: The import of 'unicodedata' is forbidden
FAILED test_01.py::Test::test_json4_00001_test_1000000_15_ita - testlib.ForbiddenError: The import of 'unicodedata' is forbidden
FAILED test_01.py::Test::test_json4_00002_test_1000000_15_eng - testlib.ForbiddenError: The import of 'unicodedata' is forbidden
========================================================================= 17 failed, 2 warnings in 13.25s =========================================================================

466 views
closed with the note: risolto

2 Answers

S
Simone_Argento01 (1150 points)
0 0 6
by (1.2k points)

È come se python non riuscisse ad importare il sistema di codifica. Se stai utilizzando anaconda prompt in windows prova le seguenti operazioni:

  1. Apri anaconda prompt come amministratore e prova a rieseguire il test
  2. Se ancora non ti funziona, importa all'interno del codice di test_01.py il modulo unicodedata nel seguente modo: import unicodedata
  3. Avvia nuovamente anaconda prompt come amministratore e riesegui il test.
Se questi 3 passaggi non hanno funzionato prova a disinstallare la libreria testlib ed a reinstallarla da anaconda prompt.
Hatlas (5340 points)
1 2 7
by (5.3k points)
edited by
Grazie, funziona.
andrea.sterbini (207920 points)
750 1267 2373
by (208k points)
Non ho provato testlib su windows, per adesso disattivate timeout e controlli settando DEBUG=True in test_01.py

Poi se necessario pubblicherò un test_01.py nuovo
Hatlas (5340 points)
1 2 7
by (5.3k points)
In test_01.py è già settato DEBUG=True e anche DEBUG=False.
Romitoskj (8920 points)
5 8 40
by (8.9k points)
Appunto, leva o commenta il la riga del false.
Hatlas (5340 points)
1 2 7
by (5.3k points)
L'avevo già provato senza aver prima disinstallato e reinstallato testlib, ora l'ho fatto e funziona. Grazie a tutti.