22 lines
597 B
Python
Executable File
22 lines
597 B
Python
Executable File
# This module defines fixtures which are shared for all tests of motor "lin1".
|
|
import time
|
|
|
|
import pytest
|
|
from setup.classes import TurboPMAC
|
|
|
|
# Prepare the motor at the start of the test by resetting and homing it.
|
|
@pytest.fixture(scope="session", autouse=True)
|
|
def reset_and_home():
|
|
mot = TurboPMAC('turboPmac1', 'ax1')
|
|
mot.put_pv('stop', 1)
|
|
mot.put_pv('reseterrorpv', 1)
|
|
mot.wait_disabled()
|
|
mot.enable_and_wait()
|
|
mot.put_pv('homeforward', 1)
|
|
time.sleep(1)
|
|
mot.wait_for_done()
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def motor():
|
|
return TurboPMAC('turboPmac1', 'ax1')
|