26 lines
579 B
Python
Executable File
26 lines
579 B
Python
Executable File
# This module defines fixtures which are shared for all tests of motor "ax1".
|
|
import time
|
|
|
|
import pytest
|
|
from src.classes import MasterMACS
|
|
|
|
|
|
@pytest.fixture(scope="session", autouse=True)
|
|
def reset_and_home():
|
|
"""
|
|
Prepare the motor at the start of the test by resetting and homing it.
|
|
"""
|
|
mot = MasterMACS('masterMacs1', '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 MasterMACS('masterMacs1', 'ax1')
|