Skip to content

Commit b86a282

Browse files
authored
Merge pull request #207 from robotpy/2023-beta
2023 beta
2 parents c08a634 + a9ea29c commit b86a282

File tree

6 files changed

+19
-15
lines changed

6 files changed

+19
-15
lines changed

.github/workflows/dist.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
ci:
14-
uses: robotpy/build-actions/.github/workflows/package-pure.yml@v2022
14+
uses: robotpy/build-actions/.github/workflows/package-pure.yml@v2023
1515
with:
1616
enable_sphinx_check: false
1717
secrets:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ FIRST Robotics Competition easier.
99
This library contains a few primary parts:
1010

1111
* A built-in uploader that will upload your robot code to the robot
12-
* Integration with the py.test testing tool to allow you to easily write unit
12+
* Integration with the pytest testing tool to allow you to easily write unit
1313
tests for your robot code.
1414
* Various support for robot simulation
1515

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ FIRST Robotics Competition easier.
88
This library contains a few primary parts:
99

1010
* A built-in uploader that will upload your robot code to the robot
11-
* Integration with the py.test testing tool to allow you to easily write unit
11+
* Integration with the pytest testing tool to allow you to easily write unit
1212
tests for your robot code.
1313
* Simulation and 'robot physics' support
1414

pyfrc/mains/cli_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from ..test_support import pytest_plugin
1313

14-
# TODO: setting the plugins so that the end user can invoke py.test directly
14+
# TODO: setting the plugins so that the end user can invoke pytest directly
1515
# could be a useful thing. Will have to consider that later.
1616

1717

@@ -24,7 +24,7 @@ class _TryAgain(Exception):
2424
#
2525
class PyFrcTest:
2626
"""
27-
Executes unit tests on the robot code using a special py.test plugin
27+
Executes unit tests on the robot code using a special pytest plugin
2828
"""
2929

3030
def __init__(self, parser=None):
@@ -67,7 +67,7 @@ def run_test(self, *a, **k):
6767

6868
def _run_test(self, pytest_args, robot_class, use_builtin, **static_options):
6969

70-
# find test directory, change current directory so py.test can find the tests
70+
# find test directory, change current directory so pytest can find the tests
7171
# -> assume that tests reside in tests or ../tests
7272

7373
curdir = pathlib.Path.cwd().absolute()

pyfrc/test_support/pytest_plugin.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import hal
1010
import hal.simulation
11-
import networktables
11+
import ntcore
1212
import wpilib
1313
from wpilib.simulation import DriverStationSim, pauseTiming, restartTiming
1414
import wpilib.simulation
@@ -87,7 +87,8 @@ def robot(self):
8787
# bubble up to the user
8888
#
8989

90-
networktables.NetworkTables.startLocal()
90+
nt_inst = ntcore.NetworkTableInstance.getDefault()
91+
nt_inst.startLocal()
9192

9293
pauseTiming()
9394
restartTiming()
@@ -107,6 +108,9 @@ def robot(self):
107108
if self._physics:
108109
self._physics.engine = None
109110

111+
# HACK: avoid motor safety deadlock
112+
wpilib.simulation._simulation._resetMotorSafety()
113+
110114
del robot
111115

112116
# Double-check all objects are destroyed so that HAL handles are released
@@ -119,7 +123,7 @@ def robot(self):
119123
# -> some reset functions will re-register listeners, so it's important
120124
# to do this before so that the listeners are active on the current
121125
# NetworkTables instance
122-
networktables.NetworkTables.stopLocal()
126+
nt_inst.stopLocal()
123127

124128
# Cleanup WPILib globals
125129
# -> preferences, SmartDashboard, LiveWindow, MotorSafety
@@ -133,7 +137,7 @@ def robot(self):
133137
hal.simulation.resetGlobalHandles()
134138

135139
# Reset the HAL data
136-
hal.simulation.resetAllData()
140+
hal.simulation.resetAllSimData()
137141

138142
# Don't call HAL shutdown! This is only used to cleanup HAL extensions,
139143
# and functions will only be called the first time (unless re-registered)

setup.cfg

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ install_requires =
3333
pint>=0.11.0
3434
importlib-metadata; python_version < '3.8'
3535

36-
robotpy-wpiutil>=2022.4.1.1,<2023
37-
pyntcore>=2022,<2023
38-
robotpy-hal>=2022.4.1.1,<2023
39-
wpilib>=2022.4.1.1,<2023
36+
robotpy-wpiutil>=2023.0.0b3.post1,<2024
37+
pyntcore>=2023.0.0b3,<2024
38+
robotpy-hal>=2023.0.0b3.post1,<2024
39+
wpilib>=2023.0.0b3,<2024
4040

41-
robotpy-installer>=2022,<2023
41+
robotpy-installer>=2023.0.0b3,<2024
4242
setup_requires =
4343
setuptools_scm > 6
4444
python_requires = >=3.6

0 commit comments

Comments
 (0)