-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[116] Fixes to kargs and kwargs, bumps version (#117)
* failing test * fixes * version bump and doc
- Loading branch information
Showing
20 changed files
with
297 additions
and
615 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
version = "0.7.2" | ||
version = "0.7.3" |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import dds | ||
import pytest | ||
from .utils import cleandir | ||
|
||
_ = cleandir | ||
|
||
path_1 = "/path_1" | ||
|
||
|
||
def f1(x, y, z): | ||
return x + y + z | ||
|
||
|
||
def f1_1(): | ||
kargs = [1, 2, 3] | ||
return dds.keep("/p1", f1, *kargs) | ||
|
||
|
||
def f1_2(): | ||
kargs = [2] | ||
kwargs = [{"z": 3}] | ||
return f1(1, *kargs, **kwargs[0]) | ||
|
||
|
||
@pytest.mark.usefixtures("cleandir") | ||
def test_kargs_1(): | ||
assert dds.eval(f1_1) == 6 | ||
assert dds.eval(f1_2) == 6 | ||
|
||
|
||
def f2(*args, **kwargs): | ||
return len(args) + len(kwargs) | ||
|
||
|
||
def f2_1(): | ||
kargs = [1, 2, 3] | ||
return dds.keep("/p1", f2, *kargs) | ||
|
||
|
||
def f2_2(): | ||
kargs = [2] | ||
kwargs = [{"z": 3}] | ||
return f2(1, *kargs, **kwargs[0]) | ||
|
||
|
||
@pytest.mark.usefixtures("cleandir") | ||
def test_kargs_2(): | ||
assert dds.eval(f2_1) == 3 | ||
assert dds.eval(f2_2) == 3 |
This file contains 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
This file contains 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
Oops, something went wrong.