Files
motorDriverTests/tests/masterMacs1/ax1/conftest.py
2025-11-03 16:31:18 +01:00

22 lines
601 B
Python
Executable File

# This module defines fixtures which are shared for all tests of motor "ax1".
import time
import pytest
from setup.classes import MasterMACS
# 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 = MasterMACS('masterMacs1', '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 MasterMACS('masterMacs1', 'ax1')