test_sanity.py 493 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. __author__ = "Christian Heider Nielsen"
  4. import sys
  5. def test_sanity():
  6. assert True
  7. assert False is not True
  8. answer_to_everything = str(42)
  9. assert str(42) == answer_to_everything
  10. def test_print(capsys):
  11. """Correct my_name argument prints"""
  12. text = "hello"
  13. err = "world"
  14. print(text)
  15. sys.stderr.write("world")
  16. captured = capsys.readouterr()
  17. assert text in captured.out
  18. assert err in captured.err