mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-09-07 02:25:21 +03:00
A product module first-imported while run_around_tests' autouse monkeypatch of gns3server.utils.path.get_default_project_directory is active (e.g. 'from gns3server.api.server import app' inside a test body) binds the patched lambda into its own namespace forever: module-level from-imports capture the object by value. Once the patch is reverted, that module keeps calling the stale lambda, which closed over the very test's tmppath — a directory deleted at that test's teardown. Every later test hitting psutil.disk_usage(get_default_project_directory()) then fails with FileNotFoundError, but only when the importing test runs before the API test files (full-suite collection order hides it). The replacement now resolves Config.instance().settings at call time instead of closing over the tmppath, so a frozen reference stays correct; the test that triggered this imports gns3_app at module top so no product import ever happens inside a patched window. Also pins pytest-random-order (inert without --random-order) and documents the order-independence rules for new tests in the gns3-api-test-writing skill, including the known-red legacy files whose tests share rows sequentially.
7 lines
307 B
Plaintext
7 lines
307 B
Plaintext
pytest==9.1.1
|
|
flake8==7.3.0
|
|
pytest-timeout==2.4.0
|
|
pytest-asyncio==1.4.0
|
|
httpx==0.28.1
|
|
httpx_ws==0.7.2 # upgrading leads to failures in tests
|
|
pytest-random-order==1.2.0 # opt-in: --random-order --random-order-bucket=global (legacy suites are not shuffle-clean yet, see .claude/skills/gns3-api-test-writing) |