GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Test for invalid bytes · python/mypy@ac275e4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • mypy/test
    • test_nativeparse.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎mypy/test/test_nativeparse.py‎

Copy file name to clipboardExpand all lines: mypy/test/test_nativeparse.py
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,10 @@ def test_trivial_binary_data_from_bytes_source(self) -> None:
285285
b, _, _, _, _, _, _, _ = parse_to_binary_ast("", Options(), b"print('hello')")
286286
self._assert_trivial_binary_data(b)
287287

288+
def test_invalid_bytes_raises(self) -> None:
289+
with self.assertRaises(UnicodeDecodeError):
290+
parse_to_binary_ast("", Options(), b"\xff")
291+
288292

289293
@contextlib.contextmanager
290294
def temp_source(text: str) -> Iterator[str]:

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.