Skip to content

Fix functional test runner and add pytest to dev deps#327

Closed
sibson wants to merge 1 commit into
mainfrom
claude/practical-planck-lvm70m
Closed

Fix functional test runner and add pytest to dev deps#327
sibson wants to merge 1 commit into
mainfrom
claude/practical-planck-lvm70m

Conversation

@sibson

@sibson sibson commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Summary

Addresses both points raised in #303.

  1. python -m unittest discover tests/functional sets the top-level dir to tests/functional, so the test modules import as top-level names 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 ($(UNITTEST_ARGS) was never defined). Fixed by running discovery with -t . and -s tests/functional, both in libvncserver.mk and the DEVELOP.rst instructions.
  2. Adds pytest to requirements-dev.txt so pytest tests/functional (as shown in Run functional tests against LibVNCServer examples #303's Testing section) works out of the box. pyvirtualdisplay was already listed.

Note: This is the alternative to #326. #326 fixes the same runner bug but stays on stdlib unittest only (no pytest dependency). Pick whichever direction you prefer for pytest.

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 top-level dir (-t .) so 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.
- Add pytest to requirements-dev.txt.

Addresses feedback on #303.
@sibson sibson closed this Jun 15, 2026
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