## Decorators Usage Guide

updated: December 08, 2017

# Decorators Usage Guide

## The decorators module

`attr`(**kwargs)

  A decorator which applies the testtools attr decorator

  This decorator applies the testtools.testcase.attr if it is in the list of attributes to testtools we want to apply.

`idempotent_id`(id)

  Stub for metadata decorator

`related_bug`(bug, status_code=None)

  A decorator useful to know solutions from launchpad bug reports

  @param bug: The launchpad bug number causing the test @param status_code: The status code related to the bug report

`skip_because`(*args, **kwargs)

  A decorator useful to skip tests hitting known bugs

  @param bug: bug number causing the test to skip @param condition: optional condition to be True for the skip to have place

class `skip_unless_attr`

  Decorator to skip tests if a specified attr does not exists or False

updated: December 08, 2017

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

found an error? report a bug questions?