Found 6 bookmarks
Custom sorting
Python: capture stdout and stderr in unittest - Adam Johnson
Python: capture stdout and stderr in unittest - Adam Johnson
When testing code that outputs to the terminal through either standard out (stdout) or standard error (stderr), you might want to capture that output and make assertions on it. To do so, use contextlib.redirect_stdout() and contextlib.redirect_stderr() to redirect the respective output streams to in-memory buffers that you can then inspect and assert on.
·adamj.eu·
Python: capture stdout and stderr in unittest - Adam Johnson
Module itertools overview
Module itertools overview
This article briefly describes the iterators available in the Python module itertools and how to use them.
·mathspp.com·
Module itertools overview
Python 3.12 Preview: Static Typing Improvements – Real Python
Python 3.12 Preview: Static Typing Improvements – Real Python
In this tutorial, you'll preview the new static typing features in Python 3.12. You'll learn about the new syntax for type variables, making generics simpler to define. You'll also see how @override lets you model inheritance and how you use typed dictionaries to annotate variable keyword arguments.
·realpython.com·
Python 3.12 Preview: Static Typing Improvements – Real Python