Exemple #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')
 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')
 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')
Exemple #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')
Exemple #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)
 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)