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

test_coroutines fails with --without-threads #69554

Closed
Arfrever mannequin opened this issue Oct 10, 2015 · 10 comments
Closed

test_coroutines fails with --without-threads #69554

Arfrever mannequin opened this issue Oct 10, 2015 · 10 comments
Labels
tests Tests in the Lib/test dir

Comments

@Arfrever
Copy link
Mannequin

Arfrever mannequin commented Oct 10, 2015

BPO 25367
Nosy @gvanrossum, @pitrou, @vstinner, @giampaolo, @serhiy-storchaka, @1st1
Files
  • coro-skip.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2015-10-11.08:54:06.656>
    created_at = <Date 2015-10-10.18:20:01.670>
    labels = ['tests']
    title = 'test_coroutines fails with --without-threads'
    updated_at = <Date 2015-10-11.08:54:33.018>
    user = 'https://bugs.python.org/Arfrever'

    bugs.python.org fields:

    activity = <Date 2015-10-11.08:54:33.018>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-10-11.08:54:06.656>
    closer = 'python-dev'
    components = ['Tests']
    creation = <Date 2015-10-10.18:20:01.670>
    creator = 'Arfrever'
    dependencies = []
    files = ['40744']
    hgrepos = []
    issue_num = 25367
    keywords = ['patch']
    message_count = 10.0
    messages = ['252735', '252749', '252756', '252759', '252760', '252776', '252778', '252779', '252786', '252787']
    nosy_count = 8.0
    nosy_names = ['gvanrossum', 'pitrou', 'vstinner', 'giampaolo.rodola', 'Arfrever', 'python-dev', 'serhiy.storchaka', 'yselivanov']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue25367'
    versions = ['Python 3.5', 'Python 3.6']

    @Arfrever
    Copy link
    Mannequin Author

    Arfrever mannequin commented Oct 10, 2015

    test.test_coroutines.CoroAsyncIOCompatTest.test_asyncio_1() fails with --without-threads, because it imports asyncio module, which is known to not work with --without-threads.
    This test should be skipped when import of asyncio fails.

    ======================================================================
    ERROR: test_asyncio_1 (test.test_coroutines.CoroAsyncIOCompatTest)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/tmp/cpython/Lib/test/test_coroutines.py", line 1325, in test_asyncio_1
        import asyncio
      File "/tmp/cpython/Lib/asyncio/__init__.py", line 21, in <module>
        from .base_events import *
      File "/tmp/cpython/Lib/asyncio/base_events.py", line 18, in <module>
        import concurrent.futures
      File "/tmp/cpython/Lib/concurrent/futures/__init__.py", line 8, in <module>
        from concurrent.futures._base import (FIRST_COMPLETED,
      File "/tmp/cpython/Lib/concurrent/futures/_base.py", line 8, in <module>
        import threading
      File "/tmp/cpython/Lib/threading.py", line 4, in <module>
        import _thread
    ImportError: No module named '_thread'

    @Arfrever Arfrever mannequin added the tests Tests in the Lib/test dir label Oct 10, 2015
    @gvanrossum
    Copy link
    Member

    Can you test with this patch?

    @Arfrever
    Copy link
    Mannequin Author

    Arfrever mannequin commented Oct 11, 2015

    It works.
    A more standard way would be 'self.skipTest(...)' instead of 'raise unittest.SkipTest(...)'.

    @serhiy-storchaka
    Copy link
    Member

    You also can use special helper: test.support.import_module().

    @gvanrossum
    Copy link
    Member

    Can one of you produce a proper patch? Then the other can review. Serhiy can commit it.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 11, 2015

    New changeset d8737b841fcf by Victor Stinner in branch '3.5':
    Close bpo-25367: Fix test_coroutines with no thread support
    https://hg.python.org/cpython/rev/d8737b841fcf

    New changeset d8002372e5df by Victor Stinner in branch 'default':
    Merge 3.5 (test_coroutines, issue bpo-25367)
    https://hg.python.org/cpython/rev/d8002372e5df

    @python-dev python-dev mannequin closed this as completed Oct 11, 2015
    @vstinner
    Copy link
    Member

    I fixed the issue based on Guido's patch and Serhiy's suggestion.

    @Arfrever
    Copy link
    Mannequin Author

    Arfrever mannequin commented Oct 11, 2015

    ======================================================================
    ERROR: test_asyncio_1 (test.test_coroutines.CoroAsyncIOCompatTest)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/tmp/cpython/Lib/test/test_coroutines.py", line 1351, in test_asyncio_1
        loop = asyncio.new_event_loop()
    NameError: name 'asyncio' is not defined

    @Arfrever Arfrever mannequin reopened this Oct 11, 2015
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 11, 2015

    New changeset 493845d905c5 by Victor Stinner in branch '3.5':
    Close bpo-25367: Fix test_coroutines()
    https://hg.python.org/cpython/rev/493845d905c5

    @python-dev python-dev mannequin closed this as completed Oct 11, 2015
    @vstinner
    Copy link
    Member

    NameError: name 'asyncio' is not defined

    Oops :-( I also fixed this one, sorry.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants