-
Notifications
You must be signed in to change notification settings - Fork 7
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
Override (Sourcery refactored) #14
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,10 +92,9 @@ def single_ctx_desc(request, _contexts): | |
hardware = hardware if isinstance(hardware, list) else [hardware] | ||
if not marker: | ||
return _contexts[0] | ||
else: | ||
for dec in _contexts: | ||
if dec["hw"] in marker.args[0]: | ||
return dec | ||
for dec in _contexts: | ||
if dec["hw"] in marker.args[0]: | ||
return dec | ||
pytest.skip("No required hardware found") | ||
|
||
|
||
|
@@ -200,16 +199,12 @@ def lookup_hw_from_map(ctx, map): | |
for attr_dict in driver_or_attr["ctx_attr"]: | ||
for attr_name in attr_dict: | ||
# loop over found and compare to | ||
for hw_ctx_attr in ctx_attrs: | ||
for hw_ctx_attr, value in ctx_attrs.items(): | ||
if ( | ||
hw_ctx_attr == attr_name | ||
and attr_dict[attr_name] | ||
in ctx_attrs[hw_ctx_attr] | ||
and attr_dict[attr_name] in value | ||
): | ||
found += 1 | ||
# Compare other attribute types ... | ||
if attr_type == "dev_attr": | ||
pass | ||
Comment on lines
-203
to
-212
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
This removes the following comments ( why? ):
|
||
continue | ||
# Loop over drivers | ||
for h in hw: | ||
|
@@ -231,10 +226,7 @@ def lookup_hw_from_map(ctx, map): | |
|
||
|
||
def find_contexts(config, map, request): | ||
if request.config.getoption("--skip-scan"): | ||
ctxs = None | ||
else: | ||
ctxs = iio.scan_contexts() | ||
ctxs = None if request.config.getoption("--skip-scan") else iio.scan_contexts() | ||
Comment on lines
-234
to
+229
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Function
|
||
if not ctxs: | ||
print("\nNo libiio contexts found") | ||
return False | ||
|
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.
Function
single_ctx_desc
refactored with the following changes:remove-unnecessary-else
)