From 451b1c8dac3bf182588e04ebe7e57c78de618f5f Mon Sep 17 00:00:00 2001 From: Eric Norige <127622562+eanorige@users.noreply.github.com> Date: Sun, 11 Feb 2024 12:56:05 -0800 Subject: [PATCH] Add name of class to error message (#28) --- pysv/model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pysv/model.py b/pysv/model.py index 1771789..9e26db4 100644 --- a/pysv/model.py +++ b/pysv/model.py @@ -27,8 +27,8 @@ def check_class_ctor(cls: type): # it's a normal init ctor # make sure that it doesn't have any extra parameters signature = inspect.signature(ctor) - assert len(signature.parameters) == 1, """Class constructor has more arguments than simple -self is required to have @sv decorator""" + assert len(signature.parameters) == 1, """Class {0} constructor with more arguments than simple +self is required to have @sv decorator""".format(cls.__name__) # generate a wrapper # need to be careful about the imports. seems all the functions have the same scope, we pick the one