0

I am going through open-stack Tempest code. I see some syntax @ used inside a class as below. Could some one give me a proper link where i can learn above why this @ is used.

  @classmethod
      def setUpClass(cls):
      cls.set_network_resources()
      super(TestLargeOpsScenario, cls).setUpClass()

or even like this,

  @attr(type='smoke')
  def test_update_setver_name(self):
        name = rand_server('server')

so what is the use of @ over here?

Naggappan Ramukannan
  • 2,564
  • 9
  • 36
  • 59
  • 2
    There are decorators. Loads of article available on it. http://legacy.python.org/dev/peps/pep-0318/ – rajpy Aug 27 '14 at 06:54
  • 1
    no pointing in down voting a question like this. questions like this actually helps people to get work done fast. – Haseeb A May 04 '18 at 06:19

2 Answers2

1

From the python docs:

Python Doc

Or a previous stackoverflow question:

Previously answered question

Community
  • 1
  • 1
mjmostachetti
  • 378
  • 1
  • 4
  • 14
0

@attr , decorator DP. More for good understanding of Decorator DP, examples at: http://thecodeship.com/patterns/guide-to-python-function-decorators/