/usr/share/pyshared/nose2/collector.py is in python-nose2 0.4.7-2.
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 | import sys
import unittest
from nose2 import loader, runner, session
from nose2.main import PluggableTestProgram
__unittest = True
def collector():
class Test(unittest.TestCase):
def run(self, result_):
ok = self._collector(result_)
sys.exit(not ok)
def _collector(self, result_):
ssn = session.Session()
ldr = loader.PluggableTestLoader(ssn)
rnr = runner.PluggableTestRunner(ssn)
ssn.loadConfigFiles('unittest.cfg', 'nose2.cfg', 'setup.cfg')
ssn.setStartDir()
ssn.prepareSysPath()
ssn.loadPlugins(PluggableTestProgram.defaultPlugins)
test = ldr.loadTestsFromNames([], None)
rslt = rnr.run(test)
return rslt.wasSuccessful()
return Test('_collector')
|