Skip to content

Commit 6be760d

Browse files
author
chenyunliang520
committed
Fix Faker string type assertion to properly handle empty string and None values
1 parent 6fca281 commit 6be760d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/fix_faker.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,11 @@ def match_any(self, spec, got, want):
320320
assert got in (None, b"", bytearray(b""), memoryview(b""))
321321
else:
322322
assert got == want
323+
elif spec == str:
324+
if want == '' or want is None:
325+
assert got == '' or got is None
326+
else:
327+
assert got == want
323328
else:
324329
assert got == want
325330

0 commit comments

Comments
 (0)