New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failure in 36.7.0 #1193

Closed
felixonmars opened this Issue Nov 10, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@felixonmars
Contributor

felixonmars commented Nov 10, 2017

There was no such issue in 36.6.1. Env info:

platform linux -- Python 3.6.3, pytest-3.2.3, py-1.4.34, pluggy-0.5.2
rootdir: /build/python-setuptools/src/setuptools-36.7.0, inifile: pytest.ini
plugins: virtualenv-1.2.11, shutil-1.2.11, flake8-0.9.1
=================================== FAILURES ===================================
________________________ Test.test_exclude_source_files ________________________

self = <setuptools.tests.test_bdist_egg.Test object at 0x7febaeb62978>
setup_context = local('/tmp/pytest-of-builduser/pytest-0/test_exclude_source_files0')
user_override = None

    def test_exclude_source_files(self, setup_context, user_override):
        dist = Distribution(dict(
            script_name='setup.py',
            script_args=['bdist_egg', '--exclude-source-files'],
            name='foo',
            py_modules=['hi'],
        ))
        with contexts.quiet():
            dist.parse_command_line()
            dist.run_commands()
        [dist_name] = os.listdir('dist')
        dist_filename = os.path.join('dist', dist_name)
        zip = zipfile.ZipFile(dist_filename)
        names = list(zi.filename for zi in zip.filelist)
>       assert 'hi.pyc' in names
E       AssertionError: assert 'hi.pyc' in ['EGG-INFO/PKG-INFO', 'EGG-INFO/SOURCES.txt', 'EGG-INFO/dependency_links.txt', 'EGG-INFO/top_level.txt', 'EGG-INFO/zip-safe']

/build/python-setuptools/src/setuptools-36.7.0/setuptools/tests/test_bdist_egg.py:61: AssertionError
@jaraco

This comment has been minimized.

Member

jaraco commented Nov 10, 2017

That's weird, because the tests pass on my machine, in appveyor, and in Travis.

So I wonder - what's different about your environment?

I tried disabling compiling of bytecode, but the test still passes.

$ git diff
diff --git a/tox.ini b/tox.ini
index 4b4b4fd8..9033f83a 100644
--- a/tox.ini
+++ b/tox.ini
@@ -6,6 +6,6 @@
 
 [testenv]
 deps=-rtests/requirements.txt
-passenv=APPDATA USERPROFILE HOMEDRIVE HOMEPATH windir APPVEYOR
+passenv=APPDATA USERPROFILE HOMEDRIVE HOMEPATH windir APPVEYOR PYTHONDONTWRITEBYTECODE
 commands=py.test {posargs}
 usedevelop=True
$ PYTHONDONTWRITEBYTECODE=1 tox -- -k bdist_egg
python develop-inst-nodeps: /Users/jaraco/Dropbox/code/main/setuptools
python installed: apipkg==1.4,contextlib2==0.5.5,execnet==1.4.1,flake8==3.3.0,foo==0.0.0,mccabe==0.6.1,mock==2.0.0,path.py==10.3.1,pbr==3.1.1,py==1.4.34,pycodestyle==2.3.1,pyflakes==1.5.0,pytest==3.1.3,pytest-fixture-config==1.2.11,pytest-flake8==0.8.1,pytest-shutil==1.2.11,pytest-virtualenv==1.2.11,six==1.10.0
python runtests: PYTHONHASHSEED='3918673267'
python runtests: commands[0] | py.test -k bdist_egg
====================================== test session starts =======================================
platform darwin -- Python 3.6.3, pytest-3.1.3, py-1.4.34, pluggy-0.4.0
rootdir: /Users/jaraco/Dropbox/code/main/setuptools, inifile: pytest.ini
plugins: virtualenv-1.2.11, shutil-1.2.11, flake8-0.8.1
collected 377 items / 2 skipped 

setuptools/tests/test_bdist_egg.py ..
setuptools/tests/test_easy_install.py .
==================================== short test summary info =====================================
SKIP [2] /Users/jaraco/Dropbox/code/main/setuptools/setuptools/tests/test_msvc.py:17: could not import 'distutils.msvc9compiler'

====================================== 374 tests deselected ======================================
====================== 3 passed, 2 skipped, 374 deselected in 1.66 seconds =======================
____________________________________________ summary _____________________________________________
  python: commands succeeded
  congratulations :)
@felixonmars

This comment has been minimized.

Contributor

felixonmars commented Nov 10, 2017

Maybe my use of pytest-runner instead of tox has something to do with this? I do have PYTHONDONTWRITEBYTECODE=1 specified.

@benoit-pierre

This comment has been minimized.

Member

benoit-pierre commented Nov 10, 2017

There's some specific handling for PYTHONDONTWRITEBYTECODE in tox: https://github.com/tox-dev/tox/blob/f1a933b59c2682f40054c0cabe8c1f42a3635168/tox/venv.py#L404

I guess that's why the issue can be seen with pytest (I can reproduce it), but not with tox.

@jaraco

This comment has been minimized.

Member

jaraco commented Nov 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment