Example #1
0
 def test_tracks_not_ok(self):
     _pytest.tracker = mock.Mock()
     location = ('test_file.py', 1, 'TestFake.test_me')
     report = mock.Mock(when='call', outcome='failed', location=location)
     _pytest.pytest_runtest_logreport(report)
     _pytest.tracker.add_not_ok.assert_called_once_with(
         'TestFake', 'TestFake.test_me')
Example #2
0
 def test_tracks_not_ok(self):
     _pytest.tracker = mock.Mock()
     location = ('test_file.py', 1, 'TestFake.test_me')
     report = mock.Mock(when='call', outcome='failed', location=location)
     _pytest.pytest_runtest_logreport(report)
     _pytest.tracker.add_not_ok.assert_called_once_with(
         'TestFake', 'TestFake.test_me')
Example #3
0
 def test_tracks_skip(self):
     _pytest.tracker = mock.Mock()
     location = ('test_file.py', 1, 'TestFake.test_me')
     longrepr = ('', '', 'Skipped: a reason')
     report = mock.Mock(
         when='call', outcome='skipped', location=location,
         longrepr=longrepr)
     _pytest.pytest_runtest_logreport(report)
     _pytest.tracker.add_skip.assert_called_once_with(
         'TestFake', 'TestFake.test_me', 'a reason')
Example #4
0
 def test_tracks_skip(self):
     _pytest.tracker = mock.Mock()
     location = ('test_file.py', 1, 'TestFake.test_me')
     longrepr = ('', '', 'Skipped: a reason')
     report = mock.Mock(when='call',
                        outcome='skipped',
                        location=location,
                        longrepr=longrepr)
     _pytest.pytest_runtest_logreport(report)
     _pytest.tracker.add_skip.assert_called_once_with(
         'TestFake', 'TestFake.test_me', 'a reason')
Example #5
0
 def test_track_when_call_report(self):
     """Only the call reports are tracked."""
     _pytest.tracker = mock.Mock()
     report = mock.Mock(when='setup', outcome='passed')
     _pytest.pytest_runtest_logreport(report)
     self.assertFalse(_pytest.tracker.add_ok.called)
Example #6
0
 def test_track_when_call_report(self):
     """Only the call reports are tracked."""
     _pytest.tracker = mock.Mock()
     report = mock.Mock(when='setup', outcome='passed')
     _pytest.pytest_runtest_logreport(report)
     self.assertFalse(_pytest.tracker.add_ok.called)