From 2e82949d13acccd8a100caa19a9b8bcf437f55be Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Thu, 3 Aug 2023 01:01:04 +0900 Subject: [PATCH] Fix coverage --- datamodel_code_generator/model/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/datamodel_code_generator/model/base.py b/datamodel_code_generator/model/base.py index 268af638e..9ce116412 100644 --- a/datamodel_code_generator/model/base.py +++ b/datamodel_code_generator/model/base.py @@ -137,7 +137,9 @@ def imports(self) -> Tuple[Import, ...]: ) and not self.data_type.use_union_operator: imports.append((IMPORT_OPTIONAL,)) else: - if self.nullable and not self.data_type.use_union_operator: + if ( + self.nullable and not self.data_type.use_union_operator + ): # pragma: no cover imports.append((IMPORT_OPTIONAL,)) if self.use_annotated: import_annotated = (