Skip to content
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

__unicode__ isn't used anymore in py3. #535

Merged
merged 1 commit into from
Jul 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sacred/config/signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def construct_arguments(self, args, kwargs, options, bound=False):
self._assert_no_missing_args(args, kwargs, bound)
return args, kwargs

def __unicode__(self):
def __str__(self):
pos_args = self.positional_args
varg = ["*" + self.vararg_name] if self.vararg_name else []
kwargs = ["{}={}".format(n, v.__repr__())
Expand Down
2 changes: 1 addition & 1 deletion tests/test_config/test_signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def test_construct_arguments_for_bound_method():
(bariza, "bariza(a, b, c)")
])
def test_unicode_(func, expected):
assert Signature(func).__unicode__() == expected
assert str(Signature(func)) == expected


@pytest.mark.parametrize('name,func', zip(names, functions))
Expand Down
4 changes: 2 additions & 2 deletions tests/test_config/test_signature_py3.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,12 @@ def test_construct_arguments_for_bound_method():
(onlykwrgs, "onlykwrgs(**kwargs)")
])
def test_unicode_(func, expected):
assert Signature(func).__unicode__() == expected
assert str(Signature(func)) == expected


def test_unicode_special():
str_signature = "complex_function_name(a=5, b='fo', c=9)"
assert str_signature in Signature(complex_function_name).__unicode__()
assert str_signature in str(Signature(complex_function_name))


@pytest.mark.parametrize('name,func', zip(names, functions))
Expand Down