-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write test for walk_files
to check if it accepts Path-like and str objects
#3035
Conversation
92a7558
to
52b75b7
Compare
Codecov Report
@@ Coverage Diff @@
## master #3035 +/- ##
==========================================
- Coverage 91.84% 91.82% -0.02%
==========================================
Files 138 138
Lines 8531 8531
==========================================
- Hits 7835 7834 -1
- Misses 696 697 +1
Continue to review full report at Codecov.
|
tests/unit/utils/test_utils.py
Outdated
path_list = [] | ||
for path in walk_files(repo_dir.root_dir): | ||
path_list.append(path) | ||
|
||
path_info_list = [] | ||
for path_info in walk_files(PathInfo(repo_dir.root_dir)): | ||
path_info_list.append(path_info) | ||
|
||
assert path_list == path_info_list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could simply
def test_walk_files(tmp_dir):
assert list(walk_files(".")) == list(walk_files(tmp_dir))
tmp_dir
is a new fixture we've introduced recently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@efiop how will convert a path into Path-like
object then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@algomaster99 tmp_dir
is a a path-like object π
@algomaster99 Could you please adjust and rebase? |
52b75b7
to
e321bea
Compare
e321bea
to
13ca5bd
Compare
@efiop I have made the necessary changes. Really, sorry for the delay. π . |
Thanks @algomaster99 ! π |
β Have you followed the guidelines in the Contributing to DVC list?
π Check this box if this PR does not require documentation updates, or if it does and you have created a separate PR in dvc.org with such updates (or at least opened an issue about it in that repo). Please link below to your PR (or issue) in the dvc.org repo.
β Have you checked DeepSource, CodeClimate, and other sanity checks below? We consider their findings recommendatory and don't expect everything to be addressed. Please review them carefully and fix those that actually improve code or fix bugs.
Thank you for the contribution - we'll try to review it as soon as possible. π
Reference: #2137