Migrate from (deprecated) nose to pytest#302
Merged
sil2100 merged 4 commits intocanonical:mainfrom Dec 14, 2022
Merged
Conversation
Pytest and pycoverage require some extra configuration to track test coverage in tests that spawn subprocesses. The new files .coveragerc and sitecustomize.py are intended to enable support for subprocesses. The test set test_terminal.py is completely skipped when testing on my system and, because of that, coverage test was reporting a low coverage. I still need to see it running in our automation to validate if we still need to skip them. Another workaround would be add a nocover to the Terminal class. Also: - Fix some deprecation warnings in some tests. - Remove this task from the TODO list :)
Also, install the new dependencies during the autopkgtest execution
Contributor
|
@daniloegea There are some fixes for |
5 tasks
sil2100
approved these changes
Dec 14, 2022
Contributor
sil2100
left a comment
There was a problem hiding this comment.
Okay, this looks like good to go. There is a missing newline, but I can fix that when merging. Also left an inline comment.
I checked the output of the CI test run here and compared this with the previous ones - coverage seems fine, tests seem to be ran as they did before. I'll merge this.
| - name: Run autopkgtest (incl. build) | ||
| run: | | ||
| sudo autopkgtest . -U --env=DPKG_GENSYMBOLS_CHECK_LEVEL=0 --env=DEB_BUILD_OPTIONS=nocheck -- lxd autopkgtest/ubuntu/jammy/amd64 | ||
| sudo autopkgtest . --setup-commands='apt -y install python3-pytest python3-pytest-cov' -U --env=DPKG_GENSYMBOLS_CHECK_LEVEL=0 --env=DEB_BUILD_OPTIONS=nocheck -- lxd autopkgtest/ubuntu/jammy/amd64 |
Contributor
There was a problem hiding this comment.
I assume this will no longer be required once we update the netplan packaging (dependencies)?
slyon
added a commit
that referenced
this pull request
Jan 3, 2023
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.
Pytest and pycoverage require some extra configuration to track test coverage in tests that spawn subprocesses. The new files .coveragerc and sitecustomize.py are intended to enable support for subprocesses.
The test set test_terminal.py is completely skipped when testing on my system and, because of that, coverage test was reporting a low coverage. I still need to see it running in our automation to validate if we still need to skip them. Another workaround would be add a nocover to the Terminal class.
Also:
Description
Checklist
make checksuccessfully.make check-coverage).