rspec/rules/S2733/python/rule.adoc

29 lines
613 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
The ``++__exit__++`` method is invoked with four arguments: self, type, value and traceback. Leave one of these out of the method declaration and the result will be a ``++TypeError++`` at runtime.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
----
class MyClass:
def __enter__(self):
pass
def __exit__(self, exc_type, exc_val): # Noncompliant
pass
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]