Skip to content

Instantly share code, notes, and snippets.

@helloworld
Created December 13, 2022 22:46
Show Gist options
  • Save helloworld/8f890bc4042fbf7058218b6d78174ba3 to your computer and use it in GitHub Desktop.
Save helloworld/8f890bc4042fbf7058218b6d78174ba3 to your computer and use it in GitHub Desktop.
============================= test session starts ==============================
platform linux -- Python 3.10.8, pytest-7.2.0, pluggy-1.0.0 -- /usr/local/bin/python
cachedir: .pytest_cache
rootdir: /tmp/tmp4p82sops
plugins: ddtrace-1.5.2, anyio-3.6.2
collecting ... collected 4 items
test.py::test_hello_world PASSED [ 25%]
test.py::test_hello_world_with_name PASSED [ 50%]
test.py::test_hello_world_with_name_and_age PASSED [ 75%]
test.py::test_hello_world_with_name_and_age_over_150_years_old FAILED [100%]
=================================== FAILURES ===================================
____________ test_hello_world_with_name_and_age_over_150_years_old _____________
def test_hello_world_with_name_and_age_over_150_years_old():
for age in [150, 151]:
> assert hello_world('John', age) == 'Hello John! Your age is invalid.'
E AssertionError: assert 'Hello John! You are 150 years old.' == 'Hello John! Your age is invalid.'
E - Hello John! Your age is invalid.
E + Hello John! You are 150 years old.
test.py:24: AssertionError
=========================== short test summary info ============================
FAILED test.py::test_hello_world_with_name_and_age_over_150_years_old - Asser...
========================= 1 failed, 3 passed in 0.03s ==========================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment