Fix functional test runner and add pytest to dev deps#327
Closed
sibson wants to merge 1 commit into
Closed
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses both points raised in #303.
python -m unittest discover tests/functionalsets the top-level dir totests/functional, so the test modules import as top-level names andfrom .cli import spawn_commandfails with "attempted relative import with no known parent package." The Makefile'stest-libvnctarget had the same bug ($(UNITTEST_ARGS)was never defined). Fixed by running discovery with-t .and-s tests/functional, both inlibvncserver.mkand theDEVELOP.rstinstructions.pytesttorequirements-dev.txtsopytest tests/functional(as shown in Run functional tests against LibVNCServer examples #303's Testing section) works out of the box.pyvirtualdisplaywas already listed.Testing
python -m unittest discover -t . -s tests/functionalnow imports modules astests.functional.*(relative imports resolve).https://claude.ai/code/session_01Tvg8Ce2dzGiY9a9Pg71pp6
Generated by Claude Code