Skip to content

Commit

Permalink
tests/fixtures: Fix FilesDef type to include bytes values
Browse files Browse the repository at this point in the history
The build_files() helper which handles these FilesDef nested dicts
already has code to handle values of type 'bytes' (they get written
verbatim instead of first being processed by DALS()).

Changing the FilesDef type to reflect this prevents Mypy from failing
when encountering legitimate bytes values in these dicts.
  • Loading branch information
jherland committed Mar 10, 2023
1 parent 8772261 commit e1f7e9d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ def setUp(self):


# Except for python/mypy#731, prefer to define
# FilesDef = Dict[str, Union['FilesDef', str]]
FilesDef = Dict[str, Union[Dict[str, Union[Dict[str, str], str]], str]]
# FilesDef = Dict[str, Union['FilesDef', str, bytes]]
FilesDef = Dict[str, Union[
Dict[str, Union[Dict[str, Union[str, bytes]], str, bytes]], str, bytes]
]


class DistInfoPkg(OnSysPath, SiteDir):
Expand Down

0 comments on commit e1f7e9d

Please sign in to comment.