Files
motorDriverTests/tests/turboPmac1/ax1/conftest.py
2025-12-05 15:44:46 +01:00

25 lines
558 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()
@pytest.fixture(autouse=True)
def motor():
return TurboPMAC('turboPmac1', 'ax1')