Skip to content

Fix functional test runner invocation (unittest discover)#326

Open
sibson wants to merge 1 commit into
mainfrom
claude/func-tests-unittest-discover
Open

Fix functional test runner invocation (unittest discover)#326
sibson wants to merge 1 commit into
mainfrom
claude/func-tests-unittest-discover

Conversation

@sibson

@sibson sibson commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the functional test runner reported broken in #303.

python -m unittest discover tests/functional sets the top-level dir to tests/functional, so the test modules are imported as top-level names (test_proxy) and from .cli import spawn_command fails with "attempted relative import with no known parent package." The Makefile's test-libvnc target had the same bug because $(UNITTEST_ARGS) was never defined.

This PR keeps the project on the standard library unittest runner (no new pytest dependency — CI and tox already use unittest discover):

  • libvncserver.mk: default UNITTEST_ARGS?=-t . and run discover $(UNITTEST_ARGS) -s tests/functional, preserving the tests.functional package context for make test-func.
  • DEVELOP.rst: documented command updated to python -m unittest discover -t . -s tests/functional.

Testing

  • python -m unittest discover -t . -s tests/functional now imports modules as tests.functional.* (relative imports resolve).

https://claude.ai/code/session_01Tvg8Ce2dzGiY9a9Pg71pp6


Generated by Claude Code

Run unittest discover with the repository as top-level dir (-t .) so the
package-relative imports in tests/functional resolve. Fixes 'attempted
relative import with no known parent package' from 'make test-func' and
the command documented in DEVELOP.rst.

Addresses feedback on #303.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants