Skip to content

Commit

Permalink
Fix value error formatting (#1827)
Browse files Browse the repository at this point in the history
  • Loading branch information
dariocurr committed Mar 21, 2023
1 parent 9da36a8 commit 3b1beb3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion faker/providers/python/__init__.py
Expand Up @@ -87,7 +87,7 @@ def pyobject(
elif object_type == dict:
return self.pydict()
else:
raise ValueError("Object type `{object_type}` is not supported by `pyobject` function")
raise ValueError(f"Object type `{object_type}` is not supported by `pyobject` function")

def pybool(self, truth_probability: int = 50) -> bool:
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/providers/test_python.py
Expand Up @@ -24,7 +24,7 @@ def test_pyobject(

@pytest.mark.parametrize("object_type", (object, type, callable))
def test_pyobject_with_unknown_object_type(object_type):
with pytest.raises(ValueError):
with pytest.raises(ValueError, match=f"Object type `{object_type}` is not supported by `pyobject` function"):
assert Faker().pyobject(object_type=object_type)


Expand Down

0 comments on commit 3b1beb3

Please sign in to comment.