def hello(): import torch hook() t = torch.tensor([1]) t + "String"
def test_hook_attached_with_args(self): _old_excepthook = sys.excepthook frosch.hook(theme="vim") self.assertEqual(frosch.pytrace_excepthook, sys.excepthook) self.assertIsNotNone(sys.excepthook.configs) self.assertEqual( type(sys.excepthook.configs.theme).__name__, "StyleMeta") sys.excepthook = _old_excepthook
def test_hook_attached(self): _old_excepthook = sys.excepthook frosch.hook() self.assertEqual(frosch.pytrace_excepthook, sys.excepthook) sys.excepthook = _old_excepthook
import sys sys.path.append("..") from frosch.frosch import hook hook() def hello(): y = "Some String" z = [1, 2, "hel"] index = 0 i = "Other string" x = ( 1 + z) def num(): return 3 hello()