def test_totals_true(): """results.Totals: bool() returns True when any value is not 0""" # This might deserve a generator, but it seems so simple that it it's a lot # of work for no gain for key in six.iterkeys(results.Totals()): test = results.Totals() test[key] += 1 nt.ok_(bool(test), msg='Returns false with status {}'.format(key))
def test_root(self): """results.TestrunResult.totals: The root is correct with subtests""" expect = results.Totals() expect['pass'] += 1 expect['crash'] += 1 expect['fail'] += 1 dict_eq(self.test['root'], expect)
def test_node_values(self): """results.TestrunResult.totals: Tests with subtests values are correct""" expect = results.Totals() expect['pass'] += 1 expect['crash'] += 1 expect['fail'] += 1 dict_eq(self.test[grouptools.join('sub', 'test')], expect)
def test_recurse(self): """results.TestrunResult.totals: Recurses correctly""" expected = results.Totals() expected['fail'] += 1 expected['crash'] += 1 expected['skip'] += 1 dict_eq(self.test['foo'], expected)
def test_root(self): """The root is correct with subtests.""" expect = results.Totals() expect['pass'] += 1 expect['crash'] += 1 expect['fail'] += 1 assert dict(self.test['root']) == dict(expect)
def test_two_parents(self): """Handles multiple parents correctly.""" expected = results.Totals() expected['crash'] += 1 expected['skip'] += 1 assert dict(self.test[grouptools.join('foo', 'foo')]) == \ dict(expected)
def test_recurse(self): """Recurses correctly.""" expected = results.Totals() expected['fail'] += 1 expected['crash'] += 1 expected['skip'] += 1 assert dict(self.test['foo']) == dict(expected)
def test_node_values(self): """Tests with subtests values are correct.""" expect = results.Totals() expect['pass'] += 1 expect['crash'] += 1 expect['fail'] += 1 assert dict(self.test[grouptools.join('sub', 'test')]) == \ dict(expect)
def test_root(self): """results.TestrunResult.totals: The root is correct""" root = results.Totals() root['pass'] += 1 root['fail'] += 1 root['crash'] += 1 root['skip'] += 1 dict_eq(self.test['root'], root)
def test_root(self): """The root is correct.""" root = results.Totals() root['pass'] += 1 root['fail'] += 1 root['crash'] += 1 root['skip'] += 1 assert dict(self.test['root']) == dict(root)
class TestTotals(object): """Tests for the totals class.""" def test_totals_false(self): """bool() returns False when all values are 0.""" assert not bool(results.Totals()) # The tuple is required because of the timeout status, which conflicts with # the timeout pylint plugin @pytest.mark.parametrize("key", ((x, ) for x in results.Totals().keys())) def test_totals_true(self, key): """bool() returns True when any value is not 0.""" test = results.Totals() test[key[0]] += 1 assert bool(test)
def test_totals_false(): """results.Totals: bool() returns False when all values are 0""" nt.ok_(not bool(results.Totals()))
def test_two_parents(self): """results.TestrunResult.totals: Handles multiple parents correctly""" expected = results.Totals() expected['crash'] += 1 expected['skip'] += 1 dict_eq(self.test[grouptools.join('foo', 'foo')], expected)
def test_totals_true(self, key): """bool() returns True when any value is not 0.""" test = results.Totals() test[key[0]] += 1 assert bool(test)
def test_totals_false(self): """bool() returns False when all values are 0.""" assert not bool(results.Totals())