Remove reference to bin when importing modules in some unit tests (BugFix)#874
Merged
Remove reference to bin when importing modules in some unit tests (BugFix)#874
Conversation
When running `./manage.py test -u` from the provider, unittest is made aware of the content of the bin/ directory so Python code from this directory can be imported directly.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #874 +/- ##
=======================================
Coverage 35.70% 35.70%
=======================================
Files 303 303
Lines 34250 34250
Branches 5917 5917
=======================================
Hits 12230 12230
Misses 21458 21458
Partials 562 562
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
kissiel
pushed a commit
that referenced
this pull request
Dec 13, 2023
…gFix) (#874) Remove reference to bin when importing modules in some unit tests When running `./manage.py test -u` from the provider, unittest is made aware of the content of the bin/ directory so Python code from this directory can be imported directly.
kissiel
pushed a commit
that referenced
this pull request
Dec 13, 2023
…gFix) (#874) Remove reference to bin when importing modules in some unit tests When running `./manage.py test -u` from the provider, unittest is made aware of the content of the bin/ directory so Python code from this directory can be imported directly.
binli
pushed a commit
to binli/checkbox
that referenced
this pull request
Mar 22, 2024
…gFix) (canonical#874) Remove reference to bin when importing modules in some unit tests When running `./manage.py test -u` from the provider, unittest is made aware of the content of the bin/ directory so Python code from this directory can be imported directly.
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.
When running
./manage.py test -ufrom the provider, unittest is made aware of the content of the bin/ directory so Python code from this directory can be imported directly.Description
When preparing a presentation about unit testing in Checkbox, I found that some unit tests import scripts from bin, which is not required when running unit tests the usual way (
./manage.py test -u).Resolved issues
Running unit tests locally using the
./manage.py test -ucommand.Tests
./manage.py test -ucommand from the base provider directory in a venv.PYTHONPATH=~/checkbox/providers/base/bin python -m unittest test_camera_quality.pyfrom theproviders/base/tests/directory.