Skip to content

Commit 03883dc

Browse files
authored
Merge pull request #29 from pangpang20/master
Fix Faker string type assertion to properly handle empty string and None
2 parents 92f9ac2 + 702a64e commit 03883dc

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)