We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9020185 commit 85fa771Copy full SHA for 85fa771
tests/expressions/test_interpreter_coverage1.py
@@ -904,6 +904,24 @@ def foo(self):
904
interpreter.execute(tree)
905
assert interpreter.get_name_value("result") == "A"
906
907
+ # Test class with super() in class level
908
+ code = """
909
+class Base:
910
+ x = 1
911
+
912
+class Derived(Base):
913
+ y = super().x + 1
914
+"""
915
+ with pytest.raises(
916
+ RuntimeError,
917
+ match=(
918
+ r"super\(\): no arguments and no context - unable to determine "
919
+ r"class and instance"
920
+ ),
921
+ ):
922
+ tree = parser.parse(code)
923
+ interpreter.execute(tree)
924
925
926
def test_visit_try():
927
parser = ExpressionsParser()
0 commit comments