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.

[HW2rec] Ulteriore errore su consegna

g
giorgioc (250 points)
2 4 5
in Avvisi by (250 points)

Ho riscontrato un ulteriore errore nel testing dell'HW2rec. Non capisco se è un problema del mio codice.

=================================== FAILURES ===================================
_______________ Test.test_json6_00001_test_init_6000_txs_1000000 _______________

self = 
acn1 = 3512, acn2 = 1060, acn3 = 5299, imd_acn1 = 1, imd_acn2 = 238
init_amount = 6000
transact_log = [[[1060, 5299], 0, 1, 19], [[5299, 1060], 1900, 1, 16], [[5299, 3512], 100, 1, 18], [[5299, 3512], 6000, 1, 20], [[3512, 5299], 4800, 1, 12], [[3512, 5299], 4800, 238, 17], ...]
expected = [[0, 0, 0], [10171, 7829], [[-99875587, -99250707, -99830542], [-99910079, -99877981, -99485369]]]

    @file_data("test_init-6000_txs-1000000.json")
    def test_json6(self, acn1, acn2, acn3, imd_acn1, imd_acn2, init_amount,
                   transact_log, expected)=
>       return self.do_test(acn1, acn2, acn3, imd_acn1, imd_acn2, init_amount,
                            transact_log, expected)

test_01.py=151= 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
test_01.py=37= in do_test
    result = program.ex1(acn1, acn2, acn3, imd_acn1, imd_acn2, init_amount, transact_log)
program01.py=124= in ex1
    run_transaction(transaction, actors)
program01.py=107= in run_transaction
    bank= Bank = Bank(actors)
program01.py=37= in __init__
    def __init__(self, actors= list)=
/home/andrea/miniconda3/lib/python3.8/site-packages/pytest_timeout.py=444= in write_title
    width = py.io.get_terminal_width()
/home/andrea/miniconda3/lib/python3.8/site-packages/py/_vendored_packages/apipkg/__init__.py=152= in __makeattr
    result = importobj(modpath, attrname)
/home/andrea/miniconda3/lib/python3.8/site-packages/py/_vendored_packages/apipkg/__init__.py=72= in importobj
    module = __import__(modpath, None, None, ['__doc__'])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = ('py._io.terminalwriter', None, None, ['__doc__']), kargs = {}
name = 'py._io.terminalwriter', rest = [None, None, ['__doc__']]

    def _check_import(*args, **kargs)=
        name, *rest = args
        if name in forbidden or (not forbidden and name not in allowed)=
            print(f"Importing {name} (globals, locals, {rest[-2=]}) (not allowed)")
>           raise ForbiddenError(f"The import of '{name}' is forbidden")
E           testlib.ForbiddenError= The import of 'py._io.terminalwriter' is forbidden

testlib.py=44= ForbiddenError
284 views

1 Answer

andrea.sterbini (207940 points)
756 1270 2377
by (208k points)
E' sempre il solito errore che viene quando pytest cerca di stampare a colori il messaggio di errore del timeout