/usr/lib/python2.7/dist-packages/pebl/test/__init__.py is in python-pebl 1.0.2-4.
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 | import tempfile
import os, os.path
import inspect
import doctest
# make sure that any files created during running tests are created in a temp
# directory (and later deleted)
location = tempfile.mkdtemp()
def setup():
os.chdir(location)
def teardown():
os.system("rm -rf %s" % location)
def testfile(fname):
"""Returns the full path for the specified file in the test directory."""
return os.path.join(
os.path.dirname(inspect.getfile(testfile)),
'testfiles',
fname
)
# so nose doesn't think it's a test
testfile.__test__ = False
def run(module=None):
failed,total = doctest.testmod(module)
print "%d of %d failed." % (failed,total)
|