This file is indexed.

/usr/lib/python2.7/dist-packages/nose2/tests/unit/test_failfast.py is in python-nose2 0.5.0-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from nose2.tests._common import TestCase
from nose2.plugins import failfast
from nose2 import result, session
from nose2.compat import unittest


class TestFailFast(TestCase):
    tags = ['unit']

    def setUp(self):
        self.session = session.Session()
        self.result = result.PluggableTestResult(self.session)
        self.plugin = failfast.FailFast(session=self.session)
        self.plugin.register()

        class Test(TestCase):

            def test(self):
                pass

            def test_err(self):
                raise Exception("oops")

            def test_fail(self):
                assert False

            @unittest.expectedFailure
            def test_fail_expected(self):
                assert False

            @unittest.skipIf(True, "Always skip")
            def test_skip(self):
                pass
        self.case = Test

    def test_sets_shouldstop_on_unexpected_error(self):
        test = self.case('test_err')
        test(self.result)
        assert self.result.shouldStop

    def test_sets_shouldstop_on_unexpected_fail(self):
        test = self.case('test_fail')
        test(self.result)
        assert self.result.shouldStop

    def test_does_not_set_shouldstop_on_expected_fail(self):
        test = self.case('test_fail_expected')
        test(self.result)
        assert not self.result.shouldStop

    def test_does_not_set_shouldstop_on_success(self):
        test = self.case('test')
        test(self.result)
        assert not self.result.shouldStop

    def test_does_not_set_shouldstop_on_skip(self):
        test = self.case('test_skip')
        test(self.result)
        assert not self.result.shouldStop