How to use _check_basic method in avocado

Best Python code snippet using avocado_python

checker.py

Source:checker.py Github

copy

Full Screen

...199 def _name(self, doc):200 name = str(doc.canonical_name)201 if isinstance(doc, RoutineDoc): name += '()'202 return name203 def _check_basic(self, doc):204 """205 Check the description, author, version, and see-also fields of206 C{doc}. This is used as a helper function by L{_check_module},207 L{_check_class}, and L{_check_func}.208 @param doc: The documentation that should be checked.209 @type doc: L{APIDoc}210 @rtype: C{None}211 """212 if ((self._checks & DocChecker.DESCR) and213 (doc.descr in (None, UNKNOWN))):214 if doc.docstring in (None, UNKNOWN):215 self.warning('Undocumented', doc)216 else:217 self.warning('No description', doc)218 if self._checks & DocChecker.AUTHOR:219 for tag, arg, descr in doc.metadata:220 if 'author' == tag: break221 else:222 self.warning('No authors', doc)223 if self._checks & DocChecker.VERSION:224 for tag, arg, descr in doc.metadata:225 if 'version' == tag: break226 else:227 self.warning('No version', doc)228 229 def _check_module(self, doc):230 """231 Run checks on the module whose APIDoc is C{doc}.232 233 @param doc: The APIDoc of the module to check.234 @type doc: L{APIDoc}235 @rtype: C{None}236 """237 if self._checks & DocChecker.MODULE:238 self._check_basic(doc)239 240 def _check_class(self, doc):241 """242 Run checks on the class whose APIDoc is C{doc}.243 244 @param doc: The APIDoc of the class to check.245 @type doc: L{APIDoc}246 @rtype: C{None}247 """248 if self._checks & DocChecker.CLASS:249 self._check_basic(doc)250 def _check_property(self, doc):251 if self._checks & DocChecker.PROPERTY:252 self._check_basic(doc)253 def _check_var(self, doc):254 """255 Run checks on the variable whose documentation is C{var} and256 whose name is C{name}.257 258 @param doc: The documentation for the variable to check.259 @type doc: L{APIDoc}260 @rtype: C{None}261 """262 if self._checks & DocChecker.VAR:263 if (self._checks & (DocChecker.DESCR|DocChecker.TYPE) and264 doc.descr in (None, UNKNOWN) and265 doc.type_descr in (None, UNKNOWN) and266 doc.docstring in (None, UNKNOWN)):267 self.warning('Undocumented', doc)268 else:269 if (self._checks & DocChecker.DESCR and270 doc.descr in (None, UNKNOWN)):271 self.warning('No description', doc)272 if (self._checks & DocChecker.TYPE and273 doc.type_descr in (None, UNKNOWN)):274 self.warning('No type information', doc)275 276 def _check_func(self, doc):277 """278 Run checks on the function whose APIDoc is C{doc}.279 280 @param doc: The APIDoc of the function to check.281 @type doc: L{APIDoc}282 @rtype: C{None}283 """284 name = doc.canonical_name285 if (self._checks & DocChecker.FUNC and286 doc.docstring in (None, UNKNOWN) and287 doc.canonical_name[-1] not in _NO_DOCS):288 self.warning('Undocumented', doc)289 return290 if (self._checks & DocChecker.FUNC and291 doc.canonical_name[-1] not in _NO_BASIC):292 self._check_basic(doc)293 if (self._checks & DocChecker.RETURN and294 doc.canonical_name[-1] not in _NO_RETURN):295 if (doc.return_type in (None, UNKNOWN) and296 doc.return_descr in (None, UNKNOWN)):297 self.warning('No return descr', doc)298 if (self._checks & DocChecker.PARAM and299 doc.canonical_name[-1] not in _NO_PARAM):300 if doc.arg_descrs in (None, UNKNOWN):301 self.warning('No argument info', doc)302 else:303 args_with_descr = []304 for arg, descr in doc.arg_descrs:305 if isinstance(arg, basestring):306 args_with_descr.append(arg)...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run avocado automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful