Opened 5 years ago

Closed 5 years ago

#14945 closed enhancement (implemented)

Use annotations for test requirements

Reported by: atagar Owned by: atagar
Priority: Low Milestone:
Component: Core Tor/Stem Version:
Severity: Keywords: testing, easy
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Presently we have runner methods for test requirements. For example...

def test_authorities_are_up_to_date(self):
  if test.runner.require_online(self):
    return
  elif test.runner.only_run_once(self):
    return

  ...

We should check to see if we can switch this to an annotation...

@run_once
@require_online
def test_authorities_are_up_to_date(self):
  ...

Not entirely sure if we can make this work in python 2.6 (that's the reason we have the 'return' conditional in the earlier bit). However, if we can this would certainly make things more elegant.

Child Tickets

Change History (1)

comment:1 Changed 5 years ago by atagar

Resolution: implemented
Status: newclosed
Note: See TracTickets for help on using tickets.