Skip to content

Commit

Permalink
hypothesis strategy: also unicode under unix+py2
Browse files Browse the repository at this point in the history
  • Loading branch information
lazka committed Jul 26, 2017
1 parent c4d913b commit 2a0e095
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ def text_to_bytes(path):
unix_path_text = unix_path_bytes.map(
lambda b: b.decode(
sys.getfilesystemencoding(), "surrogateescape"))
s.append(unix_path_text)
else:
unix_path_text = unix_path_bytes.map(
lambda b: b.decode(
sys.getfilesystemencoding(), "replace"))
s.append(unix_path_text)

return draw(sampled_from(list(map(draw, s))))

Expand Down

0 comments on commit 2a0e095

Please sign in to comment.