mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[robotpy] Mirror most other subprojects (#8208)
GitOrigin-RevId: ac60fd3cf4a24023184376687da28373d14b781a This mirrors the robotpy files for the following projects: - apriltag - datalog - hal - ntcore - romiVendordep - wpilibc - wpimath - xrpVendordep This excludes cscore and the halsim wrappers for at this time. NOTE: This does not hook these projects up to the build system, just simply mirrors the files. The building will take place in a follow up PR to make it easier to review the changes necessary to build.
This commit is contained in:
31
wpilibc/src/test/python/conftest.py
Normal file
31
wpilibc/src/test/python/conftest.py
Normal file
@@ -0,0 +1,31 @@
|
||||
import logging
|
||||
|
||||
import pytest
|
||||
import ntcore
|
||||
import wpilib
|
||||
from wpilib.simulation._simulation import _resetWpilibSimulationData
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def cfg_logging(caplog):
|
||||
caplog.set_level(logging.INFO)
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def wpilib_state():
|
||||
try:
|
||||
yield None
|
||||
finally:
|
||||
_resetWpilibSimulationData()
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def nt(cfg_logging, wpilib_state):
|
||||
instance = ntcore.NetworkTableInstance.getDefault()
|
||||
instance.startLocal()
|
||||
|
||||
try:
|
||||
yield instance
|
||||
finally:
|
||||
instance.stopLocal()
|
||||
instance._reset()
|
||||
Reference in New Issue
Block a user