Skip to content
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

All pytest tests skipped #1563

Closed
The-Compiler opened this issue May 23, 2016 · 10 comments
Closed

All pytest tests skipped #1563

The-Compiler opened this issue May 23, 2016 · 10 comments

Comments

@The-Compiler
Copy link
Member

The-Compiler commented May 23, 2016

So I tried to contribute something again, but when running tox -e py27 on the current master I get:

GLOB sdist-make: /home/florian/proj/pytest/setup.py
py27 inst-nodeps: /home/florian/proj/pytest/.tox/dist/pytest-2.9.2.dev1.zip
py27 installed: funcsigs==1.0.2,mock==2.0.0,nose==1.3.7,pbr==1.9.1,py==1.4.31,pytest==2.9.2.dev1,requests==2.10.0,six==1.10.0
py27 runtests: PYTHONHASHSEED='1720817342'
py27 runtests: commands[0] | py.test --lsof -rfsxX testing
==================================== test session starts ====================================
platform linux2 -- Python 2.7.11, pytest-2.9.2.dev1, py-1.4.31, pluggy-0.3.1
rootdir: /home/florian/proj/pytest, inifile: tox.ini
collected 1543 items 

testing/acceptance_test.py ssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
testing/test_argcomplete.py ss
testing/test_assertinterpret.py sssssssssssssssssssssssss
testing/test_assertion.py ssssssssssssssssssssssssssssssssssssssssssssssssss
testing/test_assertrewrite.py ssssssssssssssssssssssssssssssssssssssssssssss
testing/test_cache.py ssssssssssssssssss
testing/test_capture.py ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
testing/test_collection.py sssssssssssssssssssssssssssssssssss
testing/test_config.py ssssssssssssssssssssssssssssssssssssssssssssssssssssss
testing/test_conftest.py sssssssssssssssssssssssssssssssssssssssssssssss
testing/test_doctest.py ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
testing/test_genscript.py sssssss
testing/test_helpconfig.py sssssss
testing/test_junitxml.py ssssssssssssssssssssssssssssssssssssssss
testing/test_mark.py sssssssssssssssssssssssssssssssssssssssssssssssssssssssss
testing/test_monkeypatch.py ssssssssssssssssssssssssssssssss
testing/test_nose.py sssssssssssssssssss
testing/test_parseopt.py ssssssssssssssssssssssssss
testing/test_pastebin.py ssss
testing/test_pdb.py sssssssssssssssssss
testing/test_pluginmanager.py ssssssssssssssssssssssssss
testing/test_pytester.py sssssss
testing/test_recwarn.py ssssssssssssssssssssss
testing/test_resultlog.py sssssssssss
testing/test_runner.py ssssssssssssssssssssssssssssssssssssssssssssssssssssssss
testing/test_runner_xunit.py sssssssssssss
testing/test_session.py ssssssssssssssss
testing/test_skipping.py sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
testing/test_terminal.py ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
testing/test_tmpdir.py ssssssssssss
testing/test_unittest.py sssssssssssssssssssssssssssssssssssssss
testing/code/test_code.py sssssssssssssss
testing/code/test_excinfo.py ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
testing/code/test_source.py sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
testing/python/collect.py sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
testing/python/fixture.py ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
testing/python/integration.py ssssssssssssssssss
testing/python/metafunc.py sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
testing/python/raises.py ssssssssss
================================== short test summary info ==================================
SKIP [1] testing/test_conftest.py:395: skip test
[...]
SKIP [1] testing/test_assertinterpret.py:218: skip test

=============================== 1543 skipped in 1.42 seconds ================================

Any idea what's going on there?!

edit: Whoops, submitted the issue to early. Sorry!

@RonnyPfannschmidt
Copy link
Member

@The-Compiler can this be closed as "duplicate" or is there something else to it

@The-Compiler
Copy link
Member Author

As duplicate of what? I still can't run any tests locally.

@nicoddemus
Copy link
Member

I did take a quick look last week but could not find anything obvious in the test suite that would cause a skip in all tests, but more investigation is needed.

@The-Compiler
Copy link
Member Author

Suggestions on how to debug this would certainly be welcome - I searched for "skip test" but didn't find anything in the pytest code or testsuite.

@nicoddemus
Copy link
Member

Yeah, seems tricky... does this happen if you activate an environment manually and run the tests, or only when using tox?

@nicoddemus
Copy link
Member

Perhaps finding the location in the code which handles skipping and printing the traceback at that point would give a hint of why it is skipping in the first place? Sorry I can't give a more concrete suggestion, I'm short on time right now. 😦

@The-Compiler
Copy link
Member Author

Same thing when I create a virtualenv and do ./.venv/bin/pip install -e . and ./.venv/bin/py.test testing. Good suggestion, I'll give it a try.

@The-Compiler
Copy link
Member Author

If I set a breakpoint in skipping.py's pytest_runtest_setup:

@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
    # Check if skip or skipif are specified as pytest marks

    skipif_info = item.keywords.get('skipif')
    if isinstance(skipif_info, (MarkInfo, MarkDecorator)):
        eval_skipif = MarkEvaluator(item, 'skipif')
        if eval_skipif.istrue():
            item._evalskip = eval_skipif
            import pdb; pdb.set_trace()  # <-----
            pytest.skip(eval_skipif.getexplanation())

It seems indeed like every item has a MarkDecorator with a skipif:

(Pdb) item
<Function 'test_all'>
(Pdb) item.keywords.get('skipif')
<MarkDecorator 'skipif' {'kwargs': {'reason': 'skip test'}, 'args': (True,)}>

No idea yet where it's coming from.

@The-Compiler
Copy link
Member Author

Blargh... I set a breakpoint in MarkDecorator.__init__, turns out I had a conftest.py like this lying around:

import pytest

def pytest_collection_modifyitems(items):
    for item in items:
        skipif_marker = pytest.mark.skipif(True, reason='skip test')
        item.add_marker(skipif_marker)

No idea why, probably was trying out something and forgot about it... 😆

Sorry! 😊

@nicoddemus
Copy link
Member

Hehehe 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants