Skip to content

tests run twice with setup.py test in python3.5 #701

@wtayyeb

Description

@wtayyeb

Hi.
The setup.py test in python3.5 result to twice test run.

the very simple project to reproduce the problem is located at https://github.com/wtayyeb/setuptools-twice-test which have three tests

by running it via tox you could see that for py27 no test found (legacy behaviour, need discover to find them) and for py34 the behaviour is fixed and three tests were run. but in py35 it run 6 tests, as they are doublicated.

if we use setup.py test -s dummy all three environment will report 3 test run. but it is not the general way. also when run python -m unittest discover it also result correctly 3 test for each python version.

In case of using legacy woraround that create test_command that add discover to unittest args, the problem still exists for py35.

the result of tox is like below

**py27 installed:** py27 runtests: PYTHONHASHSEED='545' py27 runtests: commands[0] | python setup.py test running test running egg_info writing top-level names to dummy.egg-info\top_level.txt writing dependency_links to dummy.egg-info\dependency_links.txt writing dummy.egg-info\PKG-INFO reading manifest file 'dummy.egg-info\SOURCES.txt' writing manifest file 'dummy.egg-info\SOURCES.txt' running build_ext ---------------------------------------------------------------------- **Ran 0 tests in 0.000s** OK **py34 installed:** py34 runtests: PYTHONHASHSEED='545' py34 runtests: commands[0] | python setup.py test running test running egg_info writing dummy.egg-info\PKG-INFO writing top-level names to dummy.egg-info\top_level.txt writing dependency_links to dummy.egg-info\dependency_links.txt reading manifest file 'dummy.egg-info\SOURCES.txt' writing manifest file 'dummy.egg-info\SOURCES.txt' running build_ext test_one (dummy.test_dummy.Test) ... ok test_three (dummy.test_dummy.Test) ... ok test_two (dummy.test_dummy.Test) ... ok ---------------------------------------------------------------------- **Ran 3 tests in 0.000s** OK **py35 installed:** py35 runtests: PYTHONHASHSEED='545' py35 runtests: commands[0] | python setup.py test running test running egg_info writing dummy.egg-info\PKG-INFO writing top-level names to dummy.egg-info\top_level.txt writing dependency_links to dummy.egg-info\dependency_links.txt reading manifest file 'dummy.egg-info\SOURCES.txt' writing manifest file 'dummy.egg-info\SOURCES.txt' running build_ext test_one (dummy.test_dummy.Test) ... ok test_three (dummy.test_dummy.Test) ... ok test_two (dummy.test_dummy.Test) ... ok test_one (dummy.test_dummy.Test) ... ok test_three (dummy.test_dummy.Test) ... ok test_two (dummy.test_dummy.Test) ... ok ---------------------------------------------------------------------- **Ran 6 tests in 0.000s** OK ___________________________________ summary __________________________ py27: commands succeeded py34: commands succeeded py35: commands succeeded congratulations :) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions