26 lines
626 B
Python
Executable File
26 lines
626 B
Python
Executable File
# This module defines fixtures which are shared for all tests of motor "lin1".
|
|
import time
|
|
|
|
import pytest
|
|
from src.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.stop()
|
|
mot.reset()
|
|
mot.wait_disabled()
|
|
mot.enable_and_wait()
|
|
mot.homeforward()
|
|
time.sleep(1)
|
|
mot.wait_for_done()
|
|
mot.logger.info("Finished initial 'reset_and_home' procedure.")
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def motor():
|
|
return TurboPMAC('turboPmac1', 'ax1')
|