Repository navigation
Expand file tree
/
Copy pathpytest.ini
More file actions
33 lines (32 loc) · 1.77 KB
/
Copy pathpytest.ini
File metadata and controls
33 lines (32 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
[pytest]
# `-p no:anyio` is not a preference. The system pytest here is 6.2.5, and the
# simulator's FastAPI dependency (sim/requirements.txt) pulls pip `anyio`, whose
# pytest plugin AUTOLOADS and imports `_pytest.scope` -- added in pytest 7. So
# installing the sim deps makes a bare `pytest` die during plugin load with
# `ModuleNotFoundError: No module named '_pytest.scope'` before collecting a
# single test, which reads like a broken workspace rather than a plugin clash.
#
# Disabling the autoload rather than pinning anyio: FastAPI requires anyio>=3.4,
# so a pin fights the resolver, and nothing here uses anyio's fixtures.
# `-p no:<name>` is a no-op when the plugin is absent, so it is safe either way.
addopts = -p no:anyio
# testpaths keeps collection off the colcon `install/` trees, which otherwise get
# imported INSTEAD of the sources -- a worktree resolves them to the main
# workspace's stale copy, so a test can silently referee code that is not the
# code under edit.
#
# ⚠ `sim` IS DELIBERATELY ABSENT, and this is the reasoning rather than an
# oversight. `sim/` is a NESTED colcon workspace (its own COLCON_IGNORE and
# build_sim.sh) holding 23 tests that need the Gazebo/protobuf environment. On a
# box without it they do not merely skip -- they ERROR during collection
# (`TypeError: Descriptors cannot be created directly`) and take the whole run
# down with them.
#
# That failure is PRE-EXISTING and not introduced by the srot->main merge:
# measured on pre-merge `main`, a bare `pytest` already died exactly this way,
# because main declared no testpaths at all and so collected sim by default.
# Naming `src test` here is what makes a bare `pytest` work at all.
#
# Run the simulator's own tests from the sim environment: pytest sim/
testpaths = src test
python_files = test_*.py