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