-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
remove unused cimport, parametrize test #21710
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
Changes from 1 commit
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 |
---|---|---|
|
@@ -596,22 +596,10 @@ def _check_case(xloc, xlen, yloc, ylen, eloc, elen): | |
|
||
check_cases(_check_case) | ||
|
||
|
||
# too cute? oh but how I abhor code duplication | ||
check_ops = ['add', 'sub', 'mul', 'truediv', 'floordiv'] | ||
|
||
|
||
def make_optestf(op): | ||
def f(self): | ||
sparse_op = getattr(splib, 'sparse_%s_float64' % op) | ||
python_op = getattr(operator, op) | ||
@pytest.mark.parametrize('opname', | ||
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. worth making a fixture in conftest? 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. I think this is a pretty specific set of strings that wouldn't get used often. But I didn't look at this closely, just saw that the existing formatting was crying out to be updated. 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. ok, that's fine |
||
['add', 'sub', 'mul', 'truediv', 'floordiv']) | ||
def test_op(self, opname): | ||
sparse_op = getattr(splib, 'sparse_%s_float64' % opname) | ||
python_op = getattr(operator, opname) | ||
self._op_tests(sparse_op, python_op) | ||
|
||
f.__name__ = 'test_%s' % op | ||
return f | ||
|
||
|
||
for op in check_ops: | ||
g = make_optestf(op) | ||
setattr(TestSparseOperators, g.__name__, g) | ||
del g |
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.
do you have a linter that catches this?
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.
We've discussed this a couple times and haven't found a good solution for this. It's on my list to bring up with the group at the sprint.
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.
right, just asking if you found a soln!