Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Commit

Permalink
Remove metadata checks from arguments
Browse files Browse the repository at this point in the history
Handling instance bound variables (i.e. 'self') will have to be solved
in the CLI.
  • Loading branch information
kotfic committed Oct 10, 2018
1 parent 3bbbab0 commit 4d27401
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions girder_worker_utils/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,21 +140,19 @@ def arguments(self):
return [
self._construct_argument(
self._get_class(self._signature.parameters[name]), name)
for name in self._signature.parameters if name in self._metadata]
for name in self._signature.parameters]

@property
def varargs(self):
for name in self._signature.parameters:
if name in self._metadata and \
self._is_varargs(self._signature.parameters[name]):
if self._is_varargs(self._signature.parameters[name]):
return self._construct_argument(Varargs, name)
return None

@property
def kwargs(self):
for name in self._signature.parameters:
if name in self._metadata and \
self._is_kwargs(self._signature.parameters[name]):
if self._is_kwargs(self._signature.parameters[name]):
return self._construct_argument(Kwargs, name)
return None

Expand Down
2 changes: 1 addition & 1 deletion girder_worker_utils/tests/decorators_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def test_GWFuncDesc_keyword_args_have_defaults(func, defaults):
assert hasattr(p, 'default')
assert p.default == d


@pytest.mark.skip("Fix this to use API for accessing argument spec rather than using 'private' attribute")
def test_parameter_decorator_adds_metadata():
@parameter('a', test='TEST')
def arg(a):
Expand Down

0 comments on commit 4d27401

Please sign in to comment.