示例#1
0
    def test_it_knows_when_it_can_not_be_skipped(self):
        def testfn(c):
            pass

        example = Example(testfn, [], [])
        subject = ExampleRunner(example, Mock())
        self.assertFalse(subject.should_skip())
示例#2
0
    def test_it_records_skipped_to_formatter(self, Benchmark):
        formatter = Mock()

        example = ExampleGroup((), None, None)
        subject = ExampleRunner(example, formatter)
        subject.should_skip = Mock(return_value=True)
        subject.run()

        formatter.skip_example_group.assert_called_once_with(example)
示例#3
0
    def test_it_records_skipped_to_formatter(self, Benchmark):
        formatter = Mock()
        def testfn():
            pass

        example = Example(testfn, [], [])
        subject = ExampleRunner(example, formatter)
        subject.should_skip = Mock(return_value=True)
        subject.run()

        formatter.skip_example.assert_called_once_with(example)
示例#4
0
 def test_it_knows_when_it_can_be_skipped(self):
     example = Example(None, [], [])
     subject = ExampleRunner(example, Mock())
     self.assertTrue(subject.should_skip())