doc test fails with egg

Bug #1448979 reported by John Vandenberg on 2015-04-27
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

The tests tries to load the README file, even if it is inside an egg. It seems testtools now builds an egg before doing the testing.

$ make check
PYTHONPATH=/tmp/testscenarios/0.4/lib: python -m \
Traceback (most recent call last):
  File "/usr/lib64/python2.7/", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/site-packages/testtools/", line 399, in <module>
    main(sys.argv, sys.stdout)
  File "/usr/lib/python2.7/site-packages/testtools/", line 396, in main
  File "/usr/lib/python2.7/site-packages/testtools/", line 206, in __init__
  File "/usr/lib/python2.7/site-packages/testtools/", line 283, in parseArgs
  File "/usr/lib/python2.7/site-packages/testtools/", line 292, in createTests
  File "/usr/lib64/python2.7/unittest/", line 128, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib64/python2.7/unittest/", line 113, in loadTestsFromName
    test = obj()
  File "build/bdist.linux-x86_64/egg/testscenarios/", line 71, in test_suite
  File "build/bdist.linux-x86_64/egg/testscenarios/tests/", line 29, in test_suite
  File "build/bdist.linux-x86_64/egg/testscenarios/tests/", line 42, in load_tests
  File "/usr/lib64/python2.7/", line 2514, in DocFileSuite
    suite.addTest(DocFileTest(path, **kw))
  File "/usr/lib64/python2.7/", line 2433, in DocFileTest
    doc, path = _load_testfile(path, package, module_relative)
  File "/usr/lib64/python2.7/", line 215, in _load_testfile
    file_contents = package.__loader__.get_data(filename)
IOError: [Errno 2] No such file or directory: 'testscenarios/tests/../../../README'

The problematic code in question is in lib/testscenarios/tests/ line 42

        doctest.DocFileSuite("../../../README", optionflags=doctest.ELLIPSIS))

Robert Collins (lifeless) wrote :

I can't replicate this in either the old bzr tree or the git tree.

Changed in testscenarios:
status: New → Incomplete
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers