Tests don't pass with 'python setup.py test'

Bug #893965 reported by Jonathan Lange
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pkgme
Fix Released
High
James Westby

Bug Description

More for the "distribute / virtualenv" sucks camp:

When running 'python setup.py test' inside a no-site-packages virtualenv in trunk, you get these test failures. 'testr run' passes.

======================================================================
FAIL: test_builds_source_package (pkgme.tests.test_script.ScriptTests)
pkgme.tests.test_script.ScriptTests.test_builds_source_package
----------------------------------------------------------------------
_StringException: Traceback (most recent call last):
  File "/home/jml/src/pkgme/trunk/build/lib.linux-x86_64-2.7/pkgme/tests/test_script.py", line 42, in test_builds_source_package
    self.run_script(tempdir.abspath('foo'))
  File "/home/jml/src/pkgme/trunk/build/lib.linux-x86_64-2.7/pkgme/tests/test_script.py", line 22, in run_script
    ep(argv=[], target_dir=cwd, interactive=False)
  File "/home/jml/src/pkgme/trunk/build/lib.linux-x86_64-2.7/pkgme/bin/main.py", line 86, in main
    distribution=options.distro)
  File "/home/jml/src/pkgme/trunk/build/lib.linux-x86_64-2.7/pkgme/bin/main.py", line 25, in build_package
    write_packaging(target_dir, distribution=distribution)
  File "/home/jml/src/pkgme/trunk/build/lib.linux-x86_64-2.7/pkgme/__init__.py", line 40, in write_packaging
    info = get_info_for(path, allowed_backend_names=allowed_backend_names)
  File "/home/jml/src/pkgme/trunk/build/lib.linux-x86_64-2.7/pkgme/backend.py", line 75, in get_info_for
    return selector.get_info(path)
  File "/home/jml/src/pkgme/trunk/build/lib.linux-x86_64-2.7/pkgme/backend.py", line 249, in get_info
    score = backend.want(path)
  File "/home/jml/src/pkgme/trunk/build/lib.linux-x86_64-2.7/pkgme/backend.py", line 151, in want
    self.WANT_SCRIPT_NAME, str(result)))
AssertionError: Backend vala (/home/jml/src/pkgme/trunk/build/lib.linux-x86_64-2.7/pkgme/backends/vala) returned non-integer score from 'want' script: /home/jml/src/pkgme/trunk/build/lib.linux-x86_64-2.7/pkgme/backends/vala/want: 31: pkgme_autoconf_config: not found
0

======================================================================
FAIL: test_writes_files (pkgme.tests.test_script.ScriptTests)
pkgme.tests.test_script.ScriptTests.test_writes_files
----------------------------------------------------------------------
_StringException: Traceback (most recent call last):
  File "/home/jml/src/pkgme/trunk/build/lib.linux-x86_64-2.7/pkgme/tests/test_script.py", line 32, in test_writes_files
    self.run_script(tempdir.path)
  File "/home/jml/src/pkgme/trunk/build/lib.linux-x86_64-2.7/pkgme/tests/test_script.py", line 22, in run_script
    ep(argv=[], target_dir=cwd, interactive=False)
  File "/home/jml/src/pkgme/trunk/build/lib.linux-x86_64-2.7/pkgme/bin/main.py", line 86, in main
    distribution=options.distro)
  File "/home/jml/src/pkgme/trunk/build/lib.linux-x86_64-2.7/pkgme/bin/main.py", line 25, in build_package
    write_packaging(target_dir, distribution=distribution)
  File "/home/jml/src/pkgme/trunk/build/lib.linux-x86_64-2.7/pkgme/__init__.py", line 40, in write_packaging
    info = get_info_for(path, allowed_backend_names=allowed_backend_names)
  File "/home/jml/src/pkgme/trunk/build/lib.linux-x86_64-2.7/pkgme/backend.py", line 75, in get_info_for
    return selector.get_info(path)
  File "/home/jml/src/pkgme/trunk/build/lib.linux-x86_64-2.7/pkgme/backend.py", line 249, in get_info
    score = backend.want(path)
  File "/home/jml/src/pkgme/trunk/build/lib.linux-x86_64-2.7/pkgme/backend.py", line 151, in want
    self.WANT_SCRIPT_NAME, str(result)))
AssertionError: Backend vala (/home/jml/src/pkgme/trunk/build/lib.linux-x86_64-2.7/pkgme/backends/vala) returned non-integer score from 'want' script: /home/jml/src/pkgme/trunk/build/lib.linux-x86_64-2.7/pkgme/backends/vala/want: 31: pkgme_autoconf_config: not found
0

----------------------------------------------------------------------
Ran 180 tests in 4.738s

Related branches

Revision history for this message
James Westby (james-w) wrote : Re: [Bug 893965] [NEW] Tests don't pass with 'python setup.py test'

pkgme/run_script.py:run_script

    helperpath = os.path.join(
        os.path.dirname(os.path.dirname(basepath)), 'helpers')
    env = os.environ.copy()
    if os.path.isdir(helperpath):
        if 'PATH' in env:
            env['PATH'] = os.pathsep.join([env['PATH'], helperpath])
        else:
            env['PATH'] = helperpath

Therefore I'll do the same pkg_resources thing here to find that
directory. I don't think we need to add an entry point so backends can
provide extra helpers at this time.

Thanks,

James

James Westby (james-w)
Changed in pkgme:
status: New → In Progress
importance: Undecided → High
assignee: nobody → James Westby (james-w)
Jonathan Lange (jml)
Changed in pkgme:
status: In Progress → Fix Committed
James Westby (james-w)
Changed in pkgme:
status: Fix Committed → Fix Released
milestone: none → 0.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.