Advertisement
Guest User

ForbiddenError

a guest
Oct 21st, 2021
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. =================================== FAILURES ===================================
  2. ______________________________ Test.test_many_1s _______________________________
  3.  
  4. self =
  5.  
  6. def test_many_1s(self)=
  7. """Test with a string having 20,000 1’s and
  8. 19,001 sequences such that
  9. the sum of their values is equal to 1000
  10. [Test con una stringa avente 20,000 valori uguali a 1 e
  11. 19.001 sequenze tali che
  12. la somma dei loro valori sia uguale a 1000]"""
  13. test_seq_len = 20000
  14. test_int_seq = ",".join(['1'] * test_seq_len)
  15. test_subtotal = 1000
  16. expected = test_seq_len - test_subtotal + 1
  17. > return self.do_test(test_int_seq, test_subtotal, expected)
  18.  
  19. test_01.py=74=
  20. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  21. test_01.py=35= in do_test
  22. result = program.ex1(test_int_seq, test_subtotal)
  23. program01.py=47= in ex1
  24. partial_total += values[j]
  25. /usr/lib/python3/dist-packages/pytest_timeout.py=382= in write_title
  26. width = py.io.get_terminal_width()
  27. /usr/lib/python3/dist-packages/py/_vendored_packages/apipkg.py=148= in __makeattr
  28. result = importobj(modpath, attrname)
  29. /usr/lib/python3/dist-packages/py/_vendored_packages/apipkg.py=69= in importobj
  30. module = __import__(modpath, None, None, ['__doc__'])
  31. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  32.  
  33. args = ('py._io.terminalwriter', None, None, ['__doc__']), kargs = {}
  34. name = 'py._io.terminalwriter'
  35.  
  36. def _check_import(*args, **kargs)=
  37. name = args[0]
  38. if name in forbidden or (not forbidden and name not in allowed)=
  39. print(f"Importing {name} ({kargs}) (not allowed)")
  40. > raise ForbiddenError(f"The import of '{name}' is forbidden")
  41. E testlib.ForbiddenError= The import of 'py._io.terminalwriter' is forbidden
  42.  
  43. testlib.py=42= ForbiddenError
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement