MCPcopy Index your code
hub / github.com/datacamp/pythonwhat / assert_execution_root

Method assert_execution_root

pythonwhat/State.py:194–200  ·  view source on GitHub ↗
(self, fun, extra_msg="")

Source from the content-addressed store, hash-verified

192 return True
193
194 def assert_execution_root(self, fun, extra_msg=""):
195 if not (self.is_root or self.is_creator_type("run")):
196 with debugger(self):
197 self.report(
198 "`%s()` should only be called focusing on a full script, following `Ex()` or `run()`. %s"
199 % (fun, extra_msg)
200 )
201
202 def is_creator_type(self, type):
203 return self.creator and self.creator.get("type") == type

Callers 3

check_objectFunction · 0.80
has_printoutFunction · 0.80
has_no_errorFunction · 0.80

Calls 1

is_creator_typeMethod · 0.95

Tested by

no test coverage detected