23rd September 2021
Computer Science⚑
Programming⚑
(../python_basics.md)⚑
-
New:
str.count(sub])
.Return the number of non-overlapping occurrences of substring
sub
in the range .
(../computer_science/programming/python/pytest.md)⚑
-
New: Capture stdout/stderr output.
Use the
capfd
fixture.Example:
def test_foo(capfd): foo() # Writes "Hello World!" to stdout out, err = capfd.readouterr() assert out == "Hello World!"