Mercurial > hg > fail
view tests/test_fail.py @ 6:6496dae95f0d default tip
add a few more variables to track; we will want to output them
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Wed, 24 Aug 2016 17:05:10 -0700 |
parents | d3a4f7b41944 |
children |
line wrap: on
line source
#!/usr/bin/env python # -*- coding: utf-8 -*- """ unit tests for fail """ # imports import os import subprocess import sys import tempfile import unittest # module globals here = os.path.dirname(os.path.abspath(__file__)) fail_command = 'fail' class FailUnitTest(unittest.TestCase): def test_subprocess(self): """test fail invocation""" process = subprocess.Popen([fail_command, 'false']) process.communicate() self.assertEqual(process.returncode, 1) if __name__ == '__main__': unittest.main()