From 3d9e89dedb7b20a47062dbf64a88920e1f946eca Mon Sep 17 00:00:00 2001 From: Christian Helle Date: Mon, 14 Nov 2022 18:46:00 +0000 Subject: [PATCH] Exclude 0 when generating bytes, bytearrays, and memoryview --- src/autofaker/builtins.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/autofaker/builtins.py b/src/autofaker/builtins.py index 9616413..5a5936c 100644 --- a/src/autofaker/builtins.py +++ b/src/autofaker/builtins.py @@ -36,12 +36,12 @@ def generate(self): class BytesGenerator(TypeDataGeneratorBase): def generate(self): - return bytes(range(random.randint(0, 256))) + return bytes(range(random.randint(1, 256))) class ByteArrayGenerator(TypeDataGeneratorBase): def generate(self): - return bytearray(range(random.randint(0, 256))) + return bytearray(range(random.randint(1, 256))) class MemoryViewGenerator(TypeDataGeneratorBase):