@pytest.fixture(autouse=True)
def get_src_port(self, setup, direction):
    'Get a source port for the current test.'
    src_ports = (setup['downstream_port_ids'] if (direction == 'downlink->uplink') else setup['upstream_port_ids'])
    src_port = random.choice(src_ports)
    logger.info('Selected source port {}'.format(src_port))
    self.src_port = src_port
Get a source port for the current test.
@pytest.fixture(autouse=True)
def get_src_port(self, setup, direction):
    
    src_ports = (setup['downstream_port_ids'] if (direction == 'downlink->uplink') else setup['upstream_port_ids'])
    src_port = random.choice(src_ports)
    logger.info('Selected source port {}'.format(src_port))
    self.src_port = src_port