[copybara] Sync with robotpy (#8964)

GitOrigin-RevId: 9dff8f977401e78be0bb6f39cea2328320ab2d95
This commit is contained in:
PJ Reiniger
2026-06-08 22:22:48 -04:00
committed by GitHub
parent 0213ecf382
commit 111130d8bb
20 changed files with 1026 additions and 265 deletions

View File

@@ -1,8 +1,8 @@
import wpiutil
import time
import pytest
def test_default():
wpi_now = wpiutil.now() * 1e-6
py_now = int(time.time())
@@ -14,6 +14,7 @@ def test_default():
NOW_TIMESTAMP_S = 0
def custom_now_getter():
global NOW_TIMESTAMP_S
return int(NOW_TIMESTAMP_S * 1e6)
@@ -33,7 +34,7 @@ def test_custom_timestamp(custom_fixture):
NOW_TIMESTAMP_S = 1.5
assert 1_500_000 == wpiutil.now()
NOW_TIMESTAMP_S = 100
assert 100_000_000 == wpiutil.now()
@@ -42,5 +43,3 @@ def test_custom_timestamp(custom_fixture):
wpi_now = wpiutil.now() * 1e-6
py_now = int(time.time())
assert py_now == pytest.approx(wpi_now, abs=1)