def test_summary_status(self, initproj, capfd): initproj("logexample123-0.5", filedefs={ 'tests': { 'test_hello.py': "def test_hello(): pass" }, 'tox.ini': ''' [testenv:hello] [testenv:world] ''' }) config = parseconfig([]) session = Session(config) envs = session.venvlist assert len(envs) == 2 env1, env2 = envs env1.status = "FAIL XYZ" assert env1.status env2.status = 0 assert not env2.status session._summary() out, err = capfd.readouterr() exp = "%s: FAIL XYZ" % env1.envconfig.envname assert exp in out exp = "%s: commands succeeded" % env2.envconfig.envname assert exp in out
def test_summary_status(self, initproj, capfd): initproj( "logexample123-0.5", filedefs={ "tests": { "test_hello.py": "def test_hello(): pass" }, "tox.ini": """ [testenv:hello] [testenv:world] """, }, ) config = parseconfig([]) session = Session(config) envs = session.venvlist assert len(envs) == 2 env1, env2 = envs env1.status = "FAIL XYZ" assert env1.status env2.status = 0 assert not env2.status session._summary() out, err = capfd.readouterr() exp = "{}: FAIL XYZ".format(env1.envconfig.envname) assert exp in out exp = "{}: commands succeeded".format(env2.envconfig.envname) assert exp in out
def test_summary_status(self, initproj, capfd): initproj( "logexample123-0.5", filedefs={ "tests": {"test_hello.py": "def test_hello(): pass"}, "tox.ini": """ [testenv:hello] [testenv:world] """, }, ) config = parseconfig([]) session = Session(config) envs = session.venvlist assert len(envs) == 2 env1, env2 = envs env1.status = "FAIL XYZ" assert env1.status env2.status = 0 assert not env2.status session._summary() out, err = capfd.readouterr() exp = "%s: FAIL XYZ" % env1.envconfig.envname assert exp in out exp = "%s: commands succeeded" % env2.envconfig.envname assert exp in out