robotpy / pyfrc

python3 library designed to make developing RobotPy-based code easier!
MIT License
50 stars 35 forks source link

pyfrc tests don't work with pytest-xdist #212

Open auscompgeek opened 1 year ago

auscompgeek commented 1 year ago

Problem description

Running tests with the pytest-xdist plugin fails with errors:

[gw0] darwin -- Python 3.10.9 /.../bin/python3
file ~/dev/frc/robotpy/pyfrc/pyfrc/tests/basic.py, line 35
  @pytest.mark.filterwarnings("ignore")
  def test_disabled(control: "TestController", robot):
E       fixture 'control' not found
>       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, reraise, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id
>       use 'pytest --fixtures [testpath]' for help on them.

~/dev/frc/robotpy/pyfrc/pyfrc/tests/basic.py:35

Operating System

Windows, MacOS, Linux

Installed Python Packages

pyfrc                    2023.0.0b5.dev2+g0d04aaa6126e.d20221231
pytest                   7.2.0
pytest-forked            1.4.0
pytest-pretty            0.0.1
pytest-randomly          3.12.0
pytest-reraise           2.1.2
pytest-xdist             3.1.0

Reproducible example code

./robot.py test -- -n 2
virtuald commented 1 year ago

I wouldn't expect this to work.