Tests fail on ‘os.getcwd()’

Issue #276 invalid
Ben Finney created an issue

Running the test suite gives dozens of failures; an example:

ERROR: test_function_def (test.test_arcs.SimpleArcTest)
Traceback (most recent call last):
  File "/home/bignose/Projects/python/coverage/coveragepy.test/test/coveragetest.py", line 38, in setUp
    self.old_dir = os.getcwd()
OSError: [Errno 2] No such file or directory

Almost every failure is a “No such file or directory” error from ‘os.getcwd’. This indicates the process's current directory has already been removed. I don't know why that would happen for all those test cases.

Comments (8)

  1. Ben Finney reporter

    I'm trying to run the test suite in an isolated packaging environment, testing each Python version separately. It appears this isn't easily done with “tox”.

    How is one supposed to run the test suite without network access, and with just one Python version (instead of all in one run)?

  2. Ned Batchelder repo owner

    The test_old.sh file works to run tests outside of tox. It's the same commands as tox.ini, expressed as a shell script. Or:

    pip install nose mock
    python setup.py --quiet clean develop
    python igor.py zip_mods install_egg remove_extension
    python igor.py test_with_tracer py
    python setup.py --quiet build_ext --inplace
    python igor.py test_with_tracer c

    Also, you can run tox with just one version of Python, like: tox -e py27

  3. Ben Finney reporter

    Running under ‘tox’ isn't of use in my situation; I don't want to run the tests in a virtualenv, but in the working tree with the OS-installed packages (to confirm that the tests all pass when the dependencies are met by OS packages).

    The ‘test_old.sh’ file isn't in the source tarball.

    I'll raise a new request, to address the current inability to run the tests in this way.

  4. Log in to comment