Files
motorDriverTests/tests/turboPmac1/ax1/conftest.py
Stefan Mathis 7ab4486748 Restructured the test setup
General test configurations are now separated from specific axis test
definitions.
2025-08-11 12:01:37 +02:00

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')