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

0.18.0: testy suite is failing #1868

Closed
kloczek opened this issue Jan 20, 2021 · 3 comments
Closed

0.18.0: testy suite is failing #1868

kloczek opened this issue Jan 20, 2021 · 3 comments

Comments

@kloczek
Copy link
Contributor

kloczek commented Jan 20, 2021

+ cd trio-0.18.0
+ /usr/bin/python3 -m pytest -v
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.3, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/.hypothesis/examples')
rootdir: /home/tkloczko/rpmbuild/BUILD/trio-0.18.0, configfile: setup.cfg
plugins: flaky-3.6.1, forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, cov-2.10.1, xdist-2.2.0, asyncio-0.14.0, hypothesis-6.0.2, expect-1.1.0
collected 608 items

[..]

================================================================================= FAILURES =================================================================================
___________________________________________________________________ test_fallback_when_no_hook_claims_it ___________________________________________________________________

capsys = <_pytest.capture.CaptureFixture object at 0x7f7b86f53340>

    @pytest.mark.skipif(buggy_pypy_asyncgens, reason="pypy 7.2.0 is buggy")
    async def test_fallback_when_no_hook_claims_it(capsys):
        async def well_behaved():
            yield 42

        async def yields_after_yield():
            with pytest.raises(GeneratorExit):
                yield 42
            yield 100

        async def awaits_after_yield():
            with pytest.raises(GeneratorExit):
                yield 42
            await _core.cancel_shielded_checkpoint()

        await step_outside_async_context(well_behaved())
        gc_collect_harder()
        assert capsys.readouterr().err == ""

        await step_outside_async_context(yields_after_yield())
        gc_collect_harder()
>       assert "ignored GeneratorExit" in capsys.readouterr().err
E       AssertionError: assert 'ignored GeneratorExit' in ''
E        +  where '' = CaptureResult(out='', err='').err
E        +    where CaptureResult(out='', err='') = <bound method CaptureFixture.readouterr of <_pytest.capture.CaptureFixture object at 0x7f7b86f53340>>()
E        +      where <bound method CaptureFixture.readouterr of <_pytest.capture.CaptureFixture object at 0x7f7b86f53340>> = <_pytest.capture.CaptureFixture object at 0x7f7b86f53340>.readouterr

trio/_core/tests/test_asyncgen.py:276: AssertionError
_______________________________________________________ test_simple_cancel_scope_usage_doesnt_create_cyclic_garbage ________________________________________________________

    @pytest.mark.skipif(
        sys.implementation.name != "cpython", reason="Only makes sense with refcounting GC"
    )
    async def test_simple_cancel_scope_usage_doesnt_create_cyclic_garbage():
        # https://github.com/python-trio/trio/issues/1770
        gc.collect()

        async def do_a_cancel():
            with _core.CancelScope() as cscope:
                cscope.cancel()
                await sleep_forever()

        old_flags = gc.get_debug()
        try:
            gc.collect()
            gc.set_debug(gc.DEBUG_SAVEALL)

            await do_a_cancel()
            await do_a_cancel()

            async with _core.open_nursery() as nursery:
                nursery.start_soon(do_a_cancel)

            gc.collect()
>           assert not gc.garbage
E           AssertionError: assert not [<frame at 0x7f7b87150950, file '/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/tests/test_run.py', line 2211, c...ask_rescheduled>, <function Task._attempt_delivery_of_any_pending_cancel.<locals>.raise_cancel at 0x7f7b86c13dc0>, ...]
E            +  where [<frame at 0x7f7b87150950, file '/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/tests/test_run.py', line 2211, c...ask_rescheduled>, <function Task._attempt_delivery_of_any_pending_cancel.<locals>.raise_cancel at 0x7f7b86c13dc0>, ...] = gc.garbage

trio/_core/tests/test_run.py:2225: AssertionError
_____________________________________________________________ test_nursery_cancel_doesnt_create_cyclic_garbage _____________________________________________________________

    @pytest.mark.skipif(
        sys.implementation.name != "cpython", reason="Only makes sense with refcounting GC"
    )
    async def test_nursery_cancel_doesnt_create_cyclic_garbage():
        # https://github.com/python-trio/trio/issues/1770#issuecomment-730229423
        gc.collect()

        old_flags = gc.get_debug()
        try:
            for i in range(3):
                async with _core.open_nursery() as nursery:
                    gc.collect()
                    gc.set_debug(gc.DEBUG_LEAK)
                    nursery.cancel_scope.cancel()

                gc.collect()
                gc.set_debug(0)
>               assert not gc.garbage
E               AssertionError: assert not [Error(Cancelled()), <function checkpoint.<locals>.<lambda> at 0x7f7b86fc4ee0>, Cancelled(), <traceback object at 0x7f...d640, file '/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_run.py', line 941, code _nested_child_finished>, ...]
E                +  where [Error(Cancelled()), <function checkpoint.<locals>.<lambda> at 0x7f7b86fc4ee0>, Cancelled(), <traceback object at 0x7f...d640, file '/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_run.py', line 941, code _nested_child_finished>, ...] = gc.garbage

trio/_core/tests/test_run.py:2248: AssertionError
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
gc: collectable <Error 0x7f7b86c38b80>
gc: collectable <function 0x7f7b86fc4ee0>
gc: collectable <Cancelled 0x7f7b86b93f40>
gc: collectable <traceback 0x7f7b86c38fc0>
gc: collectable <traceback 0x7f7b86c38d40>
gc: collectable <frame 0x7f7b86c4d640>
gc: collectable <traceback 0x7f7b86c38ac0>
gc: collectable <frame 0x7f7b86bb63e0>
gc: collectable <cell 0x7f7b86f4db80>
gc: collectable <traceback 0x7f7b86eb6800>
gc: collectable <frame 0x55da7be27310>
gc: collectable <traceback 0x7f7b86c38b40>
gc: collectable <frame 0x7f7b871af780>
gc: collectable <frame 0x7f7b871644f0>
gc: collectable <frame 0x7f7b86ab7420>
gc: collectable <frame 0x7f7b86b07580>
gc: collectable <function 0x7f7b872e3b80>
gc: collectable <frame 0x7f7b8730b700>
gc: collectable <Nursery 0x7f7b86f4df40>
gc: collectable <dict 0x7f7b88af0780>
gc: collectable <CancelStatus 0x7f7b86b93e20>
gc: collectable <CancelScope 0x7f7b87175760>
gc: collectable <set 0x7f7b86c0dac0>
gc: collectable <set 0x7f7b86c0dc80>
gc: collectable <set 0x7f7b86c0d2e0>
_______________________________________________________________ test_static_tool_sees_all_symbols[jedi-trio] _______________________________________________________________

tool = 'jedi', modname = 'trio'

    @pytest.mark.redistributors_should_skip
    # pylint/jedi often have trouble with alpha releases, where Python's internals
    # are in flux, grammar may not have settled down, etc.
    @pytest.mark.skipif(
        sys.version_info.releaselevel == "alpha",
        reason="skip static introspection tools on Python dev/alpha releases",
    )
    @pytest.mark.filterwarnings(
        # https://github.com/PyCQA/astroid/issues/681
        "ignore:the imp module is deprecated.*:DeprecationWarning"
    )
    @pytest.mark.parametrize("modname", PUBLIC_MODULE_NAMES)
    @pytest.mark.parametrize("tool", ["pylint", "jedi"])
    def test_static_tool_sees_all_symbols(tool, modname):
        module = importlib.import_module(modname)

        def no_underscores(symbols):
            return {symbol for symbol in symbols if not symbol.startswith("_")}

        runtime_names = no_underscores(dir(module))

        # We should rename the trio.tests module (#274), but until then we use a
        # special-case hack:
        if modname == "trio":
            runtime_names.remove("tests")

        if tool == "pylint":
            from pylint.lint import PyLinter

            linter = PyLinter()
            ast = linter.get_ast(module.__file__, modname)
            static_names = no_underscores(ast)
        elif tool == "jedi":
            import jedi

            # Simulate typing "import trio; trio.<TAB>"
            script = jedi.Script("import {}; {}.".format(modname, modname))
>           completions = script.complete()

trio/tests/test_exports.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/jedi/api/helpers.py:456: in wrapper
    return func(self, line, column, *args, **kwargs)
/usr/lib/python3.8/site-packages/jedi/api/__init__.py:202: in complete
    return self._complete(line, column, **kwargs)
/usr/lib/python3.8/site-packages/jedi/api/__init__.py:210: in _complete
    return completion.complete()
/usr/lib/python3.8/site-packages/jedi/api/completion.py:149: in complete
    cached_name, completion_names = self._complete_python(leaf)
/usr/lib/python3.8/site-packages/jedi/api/completion.py:266: in _complete_python
    cached_name, n = self._complete_trailer(dot.get_previous_leaf())
/usr/lib/python3.8/site-packages/jedi/api/completion.py:359: in _complete_trailer
    return cached_name, self._complete_trailer_for_values(values)
/usr/lib/python3.8/site-packages/jedi/api/completion.py:369: in _complete_trailer_for_values
    if not value.is_stub() and isinstance(value, TreeInstance):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <[TypeError('expected string or bytes-like object') raised in repr()] ModuleValue object at 0x7f7b766245b0>

    def is_stub(self):
>       if self._path is not None and self._path.endswith('.pyi'):
E       AttributeError: 'PosixPath' object has no attribute 'endswith'

/usr/lib/python3.8/site-packages/jedi/inference/value/module.py:196: AttributeError
_____________________________________________________________ test_static_tool_sees_all_symbols[jedi-trio.abc] _____________________________________________________________

tool = 'jedi', modname = 'trio.abc'

    @pytest.mark.redistributors_should_skip
    # pylint/jedi often have trouble with alpha releases, where Python's internals
    # are in flux, grammar may not have settled down, etc.
    @pytest.mark.skipif(
        sys.version_info.releaselevel == "alpha",
        reason="skip static introspection tools on Python dev/alpha releases",
    )
    @pytest.mark.filterwarnings(
        # https://github.com/PyCQA/astroid/issues/681
        "ignore:the imp module is deprecated.*:DeprecationWarning"
    )
    @pytest.mark.parametrize("modname", PUBLIC_MODULE_NAMES)
    @pytest.mark.parametrize("tool", ["pylint", "jedi"])
    def test_static_tool_sees_all_symbols(tool, modname):
        module = importlib.import_module(modname)

        def no_underscores(symbols):
            return {symbol for symbol in symbols if not symbol.startswith("_")}

        runtime_names = no_underscores(dir(module))

        # We should rename the trio.tests module (#274), but until then we use a
        # special-case hack:
        if modname == "trio":
            runtime_names.remove("tests")

        if tool == "pylint":
            from pylint.lint import PyLinter

            linter = PyLinter()
            ast = linter.get_ast(module.__file__, modname)
            static_names = no_underscores(ast)
        elif tool == "jedi":
            import jedi

            # Simulate typing "import trio; trio.<TAB>"
            script = jedi.Script("import {}; {}.".format(modname, modname))
>           completions = script.complete()

trio/tests/test_exports.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/jedi/api/helpers.py:456: in wrapper
    return func(self, line, column, *args, **kwargs)
/usr/lib/python3.8/site-packages/jedi/api/__init__.py:202: in complete
    return self._complete(line, column, **kwargs)
/usr/lib/python3.8/site-packages/jedi/api/__init__.py:210: in _complete
    return completion.complete()
/usr/lib/python3.8/site-packages/jedi/api/completion.py:149: in complete
    cached_name, completion_names = self._complete_python(leaf)
/usr/lib/python3.8/site-packages/jedi/api/completion.py:266: in _complete_python
    cached_name, n = self._complete_trailer(dot.get_previous_leaf())
/usr/lib/python3.8/site-packages/jedi/api/completion.py:345: in _complete_trailer
    values = infer_call_of_leaf(inferred_context, previous_leaf)
/usr/lib/python3.8/site-packages/jedi/inference/helpers.py:109: in infer_call_of_leaf
    values = infer_trailer(context, values, trailer)
/usr/lib/python3.8/site-packages/jedi/inference/syntax_tree.py:254: in infer_trailer
    return atom_values.py__getattribute__(
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:395: in py__getattribute__
    return ValueSet.from_sets(c.py__getattribute__(*args, **kwargs) for c in self._set)
/usr/lib/python3.8/site-packages/jedi/common/value.py:32: in from_sets
    for set_ in sets:
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:395: in <genexpr>
    return ValueSet.from_sets(c.py__getattribute__(*args, **kwargs) for c in self._set)
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:89: in py__getattribute__
    values = ValueSet.from_sets(name.infer() for name in names)
/usr/lib/python3.8/site-packages/jedi/common/value.py:32: in from_sets
    for set_ in sets:
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:89: in <genexpr>
    values = ValueSet.from_sets(name.infer() for name in names)
/usr/lib/python3.8/site-packages/jedi/inference/names.py:279: in infer
    return tree_name_to_values(
/usr/lib/python3.8/site-packages/jedi/plugins/__init__.py:21: in wrapper
    return built_functions[public_name](*args, **kwargs)
/usr/lib/python3.8/site-packages/jedi/plugins/stdlib.py:825: in wrapper
    return func(inference_state, context, tree_name)
/usr/lib/python3.8/site-packages/jedi/inference/syntax_tree.py:719: in tree_name_to_values
    types = imports.infer_import(context, tree_name)
/usr/lib/python3.8/site-packages/jedi/inference/cache.py:43: in wrapper
    rv = function(obj, *args, **kwargs)
/usr/lib/python3.8/site-packages/jedi/inference/imports.py:54: in infer_import
    _prepare_infer_import(module_context, tree_name)
/usr/lib/python3.8/site-packages/jedi/inference/imports.py:114: in _prepare_infer_import
    importer = Importer(module_context.inference_state, tuple(import_path),
/usr/lib/python3.8/site-packages/jedi/inference/imports.py:168: in __init__
    debug.speed('import %s %s' % (import_path, module_context))
/usr/lib/python3.8/site-packages/jedi/inference/context.py:210: in __repr__
    return '%s(%s)' % (self.__class__.__name__, self._value)
/usr/lib/python3.8/site-packages/jedi/inference/value/module.py:263: in __repr__
    self.__class__.__name__, self._string_name,
/usr/lib/python3.8/site-packages/jedi/inference/value/module.py:125: in _string_name
    r = re.search(r'([^%s]*?)(%s__init__)?(\.pyi?|\.so)?$' % sep, self._path)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

pattern = '([^/]*?)(/__init__)?(\\.pyi?|\\.so)?$', string = PosixPath('/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/__init__.py'), flags = 0

    def search(pattern, string, flags=0):
        """Scan through string looking for a match to the pattern, returning
        a Match object, or None if no match was found."""
>       return _compile(pattern, flags).search(string)
E       TypeError: expected string or bytes-like object

/usr/lib64/python3.8/re.py:201: TypeError
___________________________________________________________ test_static_tool_sees_all_symbols[jedi-trio.socket] ____________________________________________________________

tool = 'jedi', modname = 'trio.socket'

    @pytest.mark.redistributors_should_skip
    # pylint/jedi often have trouble with alpha releases, where Python's internals
    # are in flux, grammar may not have settled down, etc.
    @pytest.mark.skipif(
        sys.version_info.releaselevel == "alpha",
        reason="skip static introspection tools on Python dev/alpha releases",
    )
    @pytest.mark.filterwarnings(
        # https://github.com/PyCQA/astroid/issues/681
        "ignore:the imp module is deprecated.*:DeprecationWarning"
    )
    @pytest.mark.parametrize("modname", PUBLIC_MODULE_NAMES)
    @pytest.mark.parametrize("tool", ["pylint", "jedi"])
    def test_static_tool_sees_all_symbols(tool, modname):
        module = importlib.import_module(modname)

        def no_underscores(symbols):
            return {symbol for symbol in symbols if not symbol.startswith("_")}

        runtime_names = no_underscores(dir(module))

        # We should rename the trio.tests module (#274), but until then we use a
        # special-case hack:
        if modname == "trio":
            runtime_names.remove("tests")

        if tool == "pylint":
            from pylint.lint import PyLinter

            linter = PyLinter()
            ast = linter.get_ast(module.__file__, modname)
            static_names = no_underscores(ast)
        elif tool == "jedi":
            import jedi

            # Simulate typing "import trio; trio.<TAB>"
            script = jedi.Script("import {}; {}.".format(modname, modname))
>           completions = script.complete()

trio/tests/test_exports.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/jedi/api/helpers.py:456: in wrapper
    return func(self, line, column, *args, **kwargs)
/usr/lib/python3.8/site-packages/jedi/api/__init__.py:202: in complete
    return self._complete(line, column, **kwargs)
/usr/lib/python3.8/site-packages/jedi/api/__init__.py:210: in _complete
    return completion.complete()
/usr/lib/python3.8/site-packages/jedi/api/completion.py:149: in complete
    cached_name, completion_names = self._complete_python(leaf)
/usr/lib/python3.8/site-packages/jedi/api/completion.py:266: in _complete_python
    cached_name, n = self._complete_trailer(dot.get_previous_leaf())
/usr/lib/python3.8/site-packages/jedi/api/completion.py:345: in _complete_trailer
    values = infer_call_of_leaf(inferred_context, previous_leaf)
/usr/lib/python3.8/site-packages/jedi/inference/helpers.py:109: in infer_call_of_leaf
    values = infer_trailer(context, values, trailer)
/usr/lib/python3.8/site-packages/jedi/inference/syntax_tree.py:254: in infer_trailer
    return atom_values.py__getattribute__(
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:395: in py__getattribute__
    return ValueSet.from_sets(c.py__getattribute__(*args, **kwargs) for c in self._set)
/usr/lib/python3.8/site-packages/jedi/common/value.py:32: in from_sets
    for set_ in sets:
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:395: in <genexpr>
    return ValueSet.from_sets(c.py__getattribute__(*args, **kwargs) for c in self._set)
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:89: in py__getattribute__
    values = ValueSet.from_sets(name.infer() for name in names)
/usr/lib/python3.8/site-packages/jedi/common/value.py:32: in from_sets
    for set_ in sets:
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:89: in <genexpr>
    values = ValueSet.from_sets(name.infer() for name in names)
/usr/lib/python3.8/site-packages/jedi/inference/names.py:279: in infer
    return tree_name_to_values(
/usr/lib/python3.8/site-packages/jedi/plugins/__init__.py:21: in wrapper
    return built_functions[public_name](*args, **kwargs)
/usr/lib/python3.8/site-packages/jedi/plugins/stdlib.py:825: in wrapper
    return func(inference_state, context, tree_name)
/usr/lib/python3.8/site-packages/jedi/inference/syntax_tree.py:719: in tree_name_to_values
    types = imports.infer_import(context, tree_name)
/usr/lib/python3.8/site-packages/jedi/inference/cache.py:43: in wrapper
    rv = function(obj, *args, **kwargs)
/usr/lib/python3.8/site-packages/jedi/inference/imports.py:54: in infer_import
    _prepare_infer_import(module_context, tree_name)
/usr/lib/python3.8/site-packages/jedi/inference/imports.py:114: in _prepare_infer_import
    importer = Importer(module_context.inference_state, tuple(import_path),
/usr/lib/python3.8/site-packages/jedi/inference/imports.py:168: in __init__
    debug.speed('import %s %s' % (import_path, module_context))
/usr/lib/python3.8/site-packages/jedi/inference/context.py:210: in __repr__
    return '%s(%s)' % (self.__class__.__name__, self._value)
/usr/lib/python3.8/site-packages/jedi/inference/value/module.py:263: in __repr__
    self.__class__.__name__, self._string_name,
/usr/lib/python3.8/site-packages/jedi/inference/value/module.py:125: in _string_name
    r = re.search(r'([^%s]*?)(%s__init__)?(\.pyi?|\.so)?$' % sep, self._path)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

pattern = '([^/]*?)(/__init__)?(\\.pyi?|\\.so)?$', string = PosixPath('/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/__init__.py'), flags = 0

    def search(pattern, string, flags=0):
        """Scan through string looking for a match to the pattern, returning
        a Match object, or None if no match was found."""
>       return _compile(pattern, flags).search(string)
E       TypeError: expected string or bytes-like object

/usr/lib64/python3.8/re.py:201: TypeError
__________________________________________________________ test_static_tool_sees_all_symbols[jedi-trio.lowlevel] ___________________________________________________________

tool = 'jedi', modname = 'trio.lowlevel'

    @pytest.mark.redistributors_should_skip
    # pylint/jedi often have trouble with alpha releases, where Python's internals
    # are in flux, grammar may not have settled down, etc.
    @pytest.mark.skipif(
        sys.version_info.releaselevel == "alpha",
        reason="skip static introspection tools on Python dev/alpha releases",
    )
    @pytest.mark.filterwarnings(
        # https://github.com/PyCQA/astroid/issues/681
        "ignore:the imp module is deprecated.*:DeprecationWarning"
    )
    @pytest.mark.parametrize("modname", PUBLIC_MODULE_NAMES)
    @pytest.mark.parametrize("tool", ["pylint", "jedi"])
    def test_static_tool_sees_all_symbols(tool, modname):
        module = importlib.import_module(modname)

        def no_underscores(symbols):
            return {symbol for symbol in symbols if not symbol.startswith("_")}

        runtime_names = no_underscores(dir(module))

        # We should rename the trio.tests module (#274), but until then we use a
        # special-case hack:
        if modname == "trio":
            runtime_names.remove("tests")

        if tool == "pylint":
            from pylint.lint import PyLinter

            linter = PyLinter()
            ast = linter.get_ast(module.__file__, modname)
            static_names = no_underscores(ast)
        elif tool == "jedi":
            import jedi

            # Simulate typing "import trio; trio.<TAB>"
            script = jedi.Script("import {}; {}.".format(modname, modname))
>           completions = script.complete()

trio/tests/test_exports.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/jedi/api/helpers.py:456: in wrapper
    return func(self, line, column, *args, **kwargs)
/usr/lib/python3.8/site-packages/jedi/api/__init__.py:202: in complete
    return self._complete(line, column, **kwargs)
/usr/lib/python3.8/site-packages/jedi/api/__init__.py:210: in _complete
    return completion.complete()
/usr/lib/python3.8/site-packages/jedi/api/completion.py:149: in complete
    cached_name, completion_names = self._complete_python(leaf)
/usr/lib/python3.8/site-packages/jedi/api/completion.py:266: in _complete_python
    cached_name, n = self._complete_trailer(dot.get_previous_leaf())
/usr/lib/python3.8/site-packages/jedi/api/completion.py:345: in _complete_trailer
    values = infer_call_of_leaf(inferred_context, previous_leaf)
/usr/lib/python3.8/site-packages/jedi/inference/helpers.py:109: in infer_call_of_leaf
    values = infer_trailer(context, values, trailer)
/usr/lib/python3.8/site-packages/jedi/inference/syntax_tree.py:254: in infer_trailer
    return atom_values.py__getattribute__(
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:395: in py__getattribute__
    return ValueSet.from_sets(c.py__getattribute__(*args, **kwargs) for c in self._set)
/usr/lib/python3.8/site-packages/jedi/common/value.py:32: in from_sets
    for set_ in sets:
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:395: in <genexpr>
    return ValueSet.from_sets(c.py__getattribute__(*args, **kwargs) for c in self._set)
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:89: in py__getattribute__
    values = ValueSet.from_sets(name.infer() for name in names)
/usr/lib/python3.8/site-packages/jedi/common/value.py:32: in from_sets
    for set_ in sets:
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:89: in <genexpr>
    values = ValueSet.from_sets(name.infer() for name in names)
/usr/lib/python3.8/site-packages/jedi/inference/names.py:279: in infer
    return tree_name_to_values(
/usr/lib/python3.8/site-packages/jedi/plugins/__init__.py:21: in wrapper
    return built_functions[public_name](*args, **kwargs)
/usr/lib/python3.8/site-packages/jedi/plugins/stdlib.py:825: in wrapper
    return func(inference_state, context, tree_name)
/usr/lib/python3.8/site-packages/jedi/inference/syntax_tree.py:719: in tree_name_to_values
    types = imports.infer_import(context, tree_name)
/usr/lib/python3.8/site-packages/jedi/inference/cache.py:43: in wrapper
    rv = function(obj, *args, **kwargs)
/usr/lib/python3.8/site-packages/jedi/inference/imports.py:54: in infer_import
    _prepare_infer_import(module_context, tree_name)
/usr/lib/python3.8/site-packages/jedi/inference/imports.py:114: in _prepare_infer_import
    importer = Importer(module_context.inference_state, tuple(import_path),
/usr/lib/python3.8/site-packages/jedi/inference/imports.py:168: in __init__
    debug.speed('import %s %s' % (import_path, module_context))
/usr/lib/python3.8/site-packages/jedi/inference/context.py:210: in __repr__
    return '%s(%s)' % (self.__class__.__name__, self._value)
/usr/lib/python3.8/site-packages/jedi/inference/value/module.py:263: in __repr__
    self.__class__.__name__, self._string_name,
/usr/lib/python3.8/site-packages/jedi/inference/value/module.py:125: in _string_name
    r = re.search(r'([^%s]*?)(%s__init__)?(\.pyi?|\.so)?$' % sep, self._path)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

pattern = '([^/]*?)(/__init__)?(\\.pyi?|\\.so)?$', string = PosixPath('/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/__init__.py'), flags = 0

    def search(pattern, string, flags=0):
        """Scan through string looking for a match to the pattern, returning
        a Match object, or None if no match was found."""
>       return _compile(pattern, flags).search(string)
E       TypeError: expected string or bytes-like object

/usr/lib64/python3.8/re.py:201: TypeError
_________________________________________________________ test_static_tool_sees_all_symbols[jedi-trio.from_thread] _________________________________________________________

tool = 'jedi', modname = 'trio.from_thread'

    @pytest.mark.redistributors_should_skip
    # pylint/jedi often have trouble with alpha releases, where Python's internals
    # are in flux, grammar may not have settled down, etc.
    @pytest.mark.skipif(
        sys.version_info.releaselevel == "alpha",
        reason="skip static introspection tools on Python dev/alpha releases",
    )
    @pytest.mark.filterwarnings(
        # https://github.com/PyCQA/astroid/issues/681
        "ignore:the imp module is deprecated.*:DeprecationWarning"
    )
    @pytest.mark.parametrize("modname", PUBLIC_MODULE_NAMES)
    @pytest.mark.parametrize("tool", ["pylint", "jedi"])
    def test_static_tool_sees_all_symbols(tool, modname):
        module = importlib.import_module(modname)

        def no_underscores(symbols):
            return {symbol for symbol in symbols if not symbol.startswith("_")}

        runtime_names = no_underscores(dir(module))

        # We should rename the trio.tests module (#274), but until then we use a
        # special-case hack:
        if modname == "trio":
            runtime_names.remove("tests")

        if tool == "pylint":
            from pylint.lint import PyLinter

            linter = PyLinter()
            ast = linter.get_ast(module.__file__, modname)
            static_names = no_underscores(ast)
        elif tool == "jedi":
            import jedi

            # Simulate typing "import trio; trio.<TAB>"
            script = jedi.Script("import {}; {}.".format(modname, modname))
>           completions = script.complete()

trio/tests/test_exports.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/jedi/api/helpers.py:456: in wrapper
    return func(self, line, column, *args, **kwargs)
/usr/lib/python3.8/site-packages/jedi/api/__init__.py:202: in complete
    return self._complete(line, column, **kwargs)
/usr/lib/python3.8/site-packages/jedi/api/__init__.py:210: in _complete
    return completion.complete()
/usr/lib/python3.8/site-packages/jedi/api/completion.py:149: in complete
    cached_name, completion_names = self._complete_python(leaf)
/usr/lib/python3.8/site-packages/jedi/api/completion.py:266: in _complete_python
    cached_name, n = self._complete_trailer(dot.get_previous_leaf())
/usr/lib/python3.8/site-packages/jedi/api/completion.py:345: in _complete_trailer
    values = infer_call_of_leaf(inferred_context, previous_leaf)
/usr/lib/python3.8/site-packages/jedi/inference/helpers.py:109: in infer_call_of_leaf
    values = infer_trailer(context, values, trailer)
/usr/lib/python3.8/site-packages/jedi/inference/syntax_tree.py:254: in infer_trailer
    return atom_values.py__getattribute__(
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:395: in py__getattribute__
    return ValueSet.from_sets(c.py__getattribute__(*args, **kwargs) for c in self._set)
/usr/lib/python3.8/site-packages/jedi/common/value.py:32: in from_sets
    for set_ in sets:
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:395: in <genexpr>
    return ValueSet.from_sets(c.py__getattribute__(*args, **kwargs) for c in self._set)
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:89: in py__getattribute__
    values = ValueSet.from_sets(name.infer() for name in names)
/usr/lib/python3.8/site-packages/jedi/common/value.py:32: in from_sets
    for set_ in sets:
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:89: in <genexpr>
    values = ValueSet.from_sets(name.infer() for name in names)
/usr/lib/python3.8/site-packages/jedi/inference/names.py:279: in infer
    return tree_name_to_values(
/usr/lib/python3.8/site-packages/jedi/plugins/__init__.py:21: in wrapper
    return built_functions[public_name](*args, **kwargs)
/usr/lib/python3.8/site-packages/jedi/plugins/stdlib.py:825: in wrapper
    return func(inference_state, context, tree_name)
/usr/lib/python3.8/site-packages/jedi/inference/syntax_tree.py:719: in tree_name_to_values
    types = imports.infer_import(context, tree_name)
/usr/lib/python3.8/site-packages/jedi/inference/cache.py:43: in wrapper
    rv = function(obj, *args, **kwargs)
/usr/lib/python3.8/site-packages/jedi/inference/imports.py:54: in infer_import
    _prepare_infer_import(module_context, tree_name)
/usr/lib/python3.8/site-packages/jedi/inference/imports.py:114: in _prepare_infer_import
    importer = Importer(module_context.inference_state, tuple(import_path),
/usr/lib/python3.8/site-packages/jedi/inference/imports.py:168: in __init__
    debug.speed('import %s %s' % (import_path, module_context))
/usr/lib/python3.8/site-packages/jedi/inference/context.py:210: in __repr__
    return '%s(%s)' % (self.__class__.__name__, self._value)
/usr/lib/python3.8/site-packages/jedi/inference/value/module.py:263: in __repr__
    self.__class__.__name__, self._string_name,
/usr/lib/python3.8/site-packages/jedi/inference/value/module.py:125: in _string_name
    r = re.search(r'([^%s]*?)(%s__init__)?(\.pyi?|\.so)?$' % sep, self._path)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

pattern = '([^/]*?)(/__init__)?(\\.pyi?|\\.so)?$', string = PosixPath('/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/__init__.py'), flags = 0

    def search(pattern, string, flags=0):
        """Scan through string looking for a match to the pattern, returning
        a Match object, or None if no match was found."""
>       return _compile(pattern, flags).search(string)
E       TypeError: expected string or bytes-like object

/usr/lib64/python3.8/re.py:201: TypeError
__________________________________________________________ test_static_tool_sees_all_symbols[jedi-trio.to_thread] __________________________________________________________

tool = 'jedi', modname = 'trio.to_thread'

    @pytest.mark.redistributors_should_skip
    # pylint/jedi often have trouble with alpha releases, where Python's internals
    # are in flux, grammar may not have settled down, etc.
    @pytest.mark.skipif(
        sys.version_info.releaselevel == "alpha",
        reason="skip static introspection tools on Python dev/alpha releases",
    )
    @pytest.mark.filterwarnings(
        # https://github.com/PyCQA/astroid/issues/681
        "ignore:the imp module is deprecated.*:DeprecationWarning"
    )
    @pytest.mark.parametrize("modname", PUBLIC_MODULE_NAMES)
    @pytest.mark.parametrize("tool", ["pylint", "jedi"])
    def test_static_tool_sees_all_symbols(tool, modname):
        module = importlib.import_module(modname)

        def no_underscores(symbols):
            return {symbol for symbol in symbols if not symbol.startswith("_")}

        runtime_names = no_underscores(dir(module))

        # We should rename the trio.tests module (#274), but until then we use a
        # special-case hack:
        if modname == "trio":
            runtime_names.remove("tests")

        if tool == "pylint":
            from pylint.lint import PyLinter

            linter = PyLinter()
            ast = linter.get_ast(module.__file__, modname)
            static_names = no_underscores(ast)
        elif tool == "jedi":
            import jedi

            # Simulate typing "import trio; trio.<TAB>"
            script = jedi.Script("import {}; {}.".format(modname, modname))
>           completions = script.complete()

trio/tests/test_exports.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/jedi/api/helpers.py:456: in wrapper
    return func(self, line, column, *args, **kwargs)
/usr/lib/python3.8/site-packages/jedi/api/__init__.py:202: in complete
    return self._complete(line, column, **kwargs)
/usr/lib/python3.8/site-packages/jedi/api/__init__.py:210: in _complete
    return completion.complete()
/usr/lib/python3.8/site-packages/jedi/api/completion.py:149: in complete
    cached_name, completion_names = self._complete_python(leaf)
/usr/lib/python3.8/site-packages/jedi/api/completion.py:266: in _complete_python
    cached_name, n = self._complete_trailer(dot.get_previous_leaf())
/usr/lib/python3.8/site-packages/jedi/api/completion.py:345: in _complete_trailer
    values = infer_call_of_leaf(inferred_context, previous_leaf)
/usr/lib/python3.8/site-packages/jedi/inference/helpers.py:109: in infer_call_of_leaf
    values = infer_trailer(context, values, trailer)
/usr/lib/python3.8/site-packages/jedi/inference/syntax_tree.py:254: in infer_trailer
    return atom_values.py__getattribute__(
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:395: in py__getattribute__
    return ValueSet.from_sets(c.py__getattribute__(*args, **kwargs) for c in self._set)
/usr/lib/python3.8/site-packages/jedi/common/value.py:32: in from_sets
    for set_ in sets:
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:395: in <genexpr>
    return ValueSet.from_sets(c.py__getattribute__(*args, **kwargs) for c in self._set)
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:89: in py__getattribute__
    values = ValueSet.from_sets(name.infer() for name in names)
/usr/lib/python3.8/site-packages/jedi/common/value.py:32: in from_sets
    for set_ in sets:
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:89: in <genexpr>
    values = ValueSet.from_sets(name.infer() for name in names)
/usr/lib/python3.8/site-packages/jedi/inference/names.py:279: in infer
    return tree_name_to_values(
/usr/lib/python3.8/site-packages/jedi/plugins/__init__.py:21: in wrapper
    return built_functions[public_name](*args, **kwargs)
/usr/lib/python3.8/site-packages/jedi/plugins/stdlib.py:825: in wrapper
    return func(inference_state, context, tree_name)
/usr/lib/python3.8/site-packages/jedi/inference/syntax_tree.py:719: in tree_name_to_values
    types = imports.infer_import(context, tree_name)
/usr/lib/python3.8/site-packages/jedi/inference/cache.py:43: in wrapper
    rv = function(obj, *args, **kwargs)
/usr/lib/python3.8/site-packages/jedi/inference/imports.py:54: in infer_import
    _prepare_infer_import(module_context, tree_name)
/usr/lib/python3.8/site-packages/jedi/inference/imports.py:114: in _prepare_infer_import
    importer = Importer(module_context.inference_state, tuple(import_path),
/usr/lib/python3.8/site-packages/jedi/inference/imports.py:168: in __init__
    debug.speed('import %s %s' % (import_path, module_context))
/usr/lib/python3.8/site-packages/jedi/inference/context.py:210: in __repr__
    return '%s(%s)' % (self.__class__.__name__, self._value)
/usr/lib/python3.8/site-packages/jedi/inference/value/module.py:263: in __repr__
    self.__class__.__name__, self._string_name,
/usr/lib/python3.8/site-packages/jedi/inference/value/module.py:125: in _string_name
    r = re.search(r'([^%s]*?)(%s__init__)?(\.pyi?|\.so)?$' % sep, self._path)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

pattern = '([^/]*?)(/__init__)?(\\.pyi?|\\.so)?$', string = PosixPath('/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/__init__.py'), flags = 0

    def search(pattern, string, flags=0):
        """Scan through string looking for a match to the pattern, returning
        a Match object, or None if no match was found."""
>       return _compile(pattern, flags).search(string)
E       TypeError: expected string or bytes-like object

/usr/lib64/python3.8/re.py:201: TypeError
___________________________________________________________ test_static_tool_sees_all_symbols[jedi-trio.testing] ___________________________________________________________

self = <SubModuleName: string_name=testing start_pos=(1, 0)>, args = (), kwargs = {}, cache_dict = {<function ImportName.infer at 0x7f7b76a88940>: {}}, dct = {}
key = ((), frozenset())

    @wraps(method)
    def wrapper(self, *args, **kwargs):
        cache_dict = self.__dict__.setdefault('_memoize_method_dct', {})
        dct = cache_dict.setdefault(method, {})
        key = (args, frozenset(kwargs.items()))
        try:
>           return dct[key]
E           KeyError: ((), frozenset())

/usr/lib/python3.8/site-packages/jedi/cache.py:109: KeyError

During handling of the above exception, another exception occurred:

tool = 'jedi', modname = 'trio.testing'

    @pytest.mark.redistributors_should_skip
    # pylint/jedi often have trouble with alpha releases, where Python's internals
    # are in flux, grammar may not have settled down, etc.
    @pytest.mark.skipif(
        sys.version_info.releaselevel == "alpha",
        reason="skip static introspection tools on Python dev/alpha releases",
    )
    @pytest.mark.filterwarnings(
        # https://github.com/PyCQA/astroid/issues/681
        "ignore:the imp module is deprecated.*:DeprecationWarning"
    )
    @pytest.mark.parametrize("modname", PUBLIC_MODULE_NAMES)
    @pytest.mark.parametrize("tool", ["pylint", "jedi"])
    def test_static_tool_sees_all_symbols(tool, modname):
        module = importlib.import_module(modname)

        def no_underscores(symbols):
            return {symbol for symbol in symbols if not symbol.startswith("_")}

        runtime_names = no_underscores(dir(module))

        # We should rename the trio.tests module (#274), but until then we use a
        # special-case hack:
        if modname == "trio":
            runtime_names.remove("tests")

        if tool == "pylint":
            from pylint.lint import PyLinter

            linter = PyLinter()
            ast = linter.get_ast(module.__file__, modname)
            static_names = no_underscores(ast)
        elif tool == "jedi":
            import jedi

            # Simulate typing "import trio; trio.<TAB>"
            script = jedi.Script("import {}; {}.".format(modname, modname))
>           completions = script.complete()

trio/tests/test_exports.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.8/site-packages/jedi/api/helpers.py:456: in wrapper
    return func(self, line, column, *args, **kwargs)
/usr/lib/python3.8/site-packages/jedi/api/__init__.py:202: in complete
    return self._complete(line, column, **kwargs)
/usr/lib/python3.8/site-packages/jedi/api/__init__.py:210: in _complete
    return completion.complete()
/usr/lib/python3.8/site-packages/jedi/api/completion.py:149: in complete
    cached_name, completion_names = self._complete_python(leaf)
/usr/lib/python3.8/site-packages/jedi/api/completion.py:266: in _complete_python
    cached_name, n = self._complete_trailer(dot.get_previous_leaf())
/usr/lib/python3.8/site-packages/jedi/api/completion.py:345: in _complete_trailer
    values = infer_call_of_leaf(inferred_context, previous_leaf)
/usr/lib/python3.8/site-packages/jedi/inference/helpers.py:109: in infer_call_of_leaf
    values = infer_trailer(context, values, trailer)
/usr/lib/python3.8/site-packages/jedi/inference/syntax_tree.py:254: in infer_trailer
    return atom_values.py__getattribute__(
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:395: in py__getattribute__
    return ValueSet.from_sets(c.py__getattribute__(*args, **kwargs) for c in self._set)
/usr/lib/python3.8/site-packages/jedi/common/value.py:32: in from_sets
    for set_ in sets:
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:395: in <genexpr>
    return ValueSet.from_sets(c.py__getattribute__(*args, **kwargs) for c in self._set)
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:89: in py__getattribute__
    values = ValueSet.from_sets(name.infer() for name in names)
/usr/lib/python3.8/site-packages/jedi/common/value.py:32: in from_sets
    for set_ in sets:
/usr/lib/python3.8/site-packages/jedi/inference/base_value.py:89: in <genexpr>
    values = ValueSet.from_sets(name.infer() for name in names)
/usr/lib/python3.8/site-packages/jedi/cache.py:111: in wrapper
    result = method(self, *args, **kwargs)
/usr/lib/python3.8/site-packages/jedi/inference/names.py:590: in infer
    return Importer(m.inference_state, [self.string_name], m, level=self._level).follow()
/usr/lib/python3.8/site-packages/jedi/inference/imports.py:168: in __init__
    debug.speed('import %s %s' % (import_path, module_context))
/usr/lib/python3.8/site-packages/jedi/inference/context.py:210: in __repr__
    return '%s(%s)' % (self.__class__.__name__, self._value)
/usr/lib/python3.8/site-packages/jedi/inference/value/module.py:263: in __repr__
    self.__class__.__name__, self._string_name,
/usr/lib/python3.8/site-packages/jedi/inference/value/module.py:125: in _string_name
    r = re.search(r'([^%s]*?)(%s__init__)?(\.pyi?|\.so)?$' % sep, self._path)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

pattern = '([^/]*?)(/__init__)?(\\.pyi?|\\.so)?$', string = PosixPath('/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/__init__.py'), flags = 0

    def search(pattern, string, flags=0):
        """Scan through string looking for a match to the pattern, returning
        a Match object, or None if no match was found."""
>       return _compile(pattern, flags).search(string)
E       TypeError: expected string or bytes-like object

/usr/lib64/python3.8/re.py:201: TypeError
============================================================================= warnings summary =============================================================================
trio/_core/tests/test_asyncgen.py::test_fallback_when_no_hook_claims_it
  /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning: Exception ignored in: <async_generator object test_fallback_when_no_hook_claims_it.<locals>.yields_after_yield at 0x7f7b86ae8b80>

  Traceback (most recent call last):
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_asyncgens.py", line 101, in finalizer
      closer.send(None)
  RuntimeError: async generator ignored GeneratorExit

    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))

trio/_core/tests/test_guest_mode.py::test_guest_warns_if_abandoned
  /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning: Exception ignored in: <coroutine object Runner.init at 0x7f7b86f55440>

  Traceback (most recent call last):
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_run.py", line 1596, in init
      self.spawn_impl(
  GeneratorExit

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_generated_run.py", line 53, in current_time
      return GLOBAL_RUN_CONTEXT.runner.current_time()
  AttributeError: 'RunContext' object has no attribute 'runner'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_run.py", line 1605, in init
      self.system_nursery.cancel_scope.cancel()
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_run.py", line 802, in __aexit__
      new_exc = await self._nursery._nested_child_finished(exc)
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_run.py", line 914, in _nested_child_finished
      self._add_exc(nested_child_exc)
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_run.py", line 896, in _add_exc
      self.cancel_scope.cancel()
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_ki.py", line 159, in wrapper
      return fn(*args, **kwargs)
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_run.py", line 681, in cancel
      self._cancel_status.recalculate()
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_run.py", line 350, in recalculate
      current._scope.cancel_called
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_run.py", line 708, in cancel_called
      if not self._cancel_called and current_time() >= self._deadline:
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_generated_run.py", line 55, in current_time
      raise RuntimeError("must be called from async context")
  RuntimeError: must be called from async context

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_run.py", line 1613, in init
      run_sync_soon_nursery.cancel_scope.cancel()
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_run.py", line 802, in __aexit__
      new_exc = await self._nursery._nested_child_finished(exc)
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_run.py", line 914, in _nested_child_finished
      self._add_exc(nested_child_exc)
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_run.py", line 896, in _add_exc
      self.cancel_scope.cancel()
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_ki.py", line 159, in wrapper
      return fn(*args, **kwargs)
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_run.py", line 681, in cancel
      self._cancel_status.recalculate()
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_run.py", line 357, in recalculate
      task._attempt_delivery_of_any_pending_cancel()
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_run.py", line 1174, in _attempt_delivery_of_any_pending_cancel
      self._attempt_abort(raise_cancel)
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_run.py", line 1156, in _attempt_abort
      success = self._abort_func(raise_cancel)
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_io_epoll.py", line 292, in abort
      self._update_registrations(fd)
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_io_epoll.py", line 261, in _update_registrations
      self._epoll.modify(fd, wanted_flags | select.EPOLLONESHOT)
  ValueError: I/O operation on closed epoll object

    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))

trio/_core/tests/test_guest_mode.py::test_guest_mode_asyncgens
trio/_core/tests/test_run.py::test_error_in_run_loop
  /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning: Exception ignored in: <function Nursery.__del__ at 0x7f7b87472d30>

  Traceback (most recent call last):
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_run.py", line 1055, in __del__
      assert not self._children
  AssertionError

    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))

trio/_core/tests/test_run.py::test_broken_abort
  /usr/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning: Exception ignored in: <coroutine object test_broken_abort.<locals>.main at 0x7f7b8716c240>

  Traceback (most recent call last):
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/tests/test_run.py", line 861, in main
      await _core.wait_task_rescheduled(lambda _: None)
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_ki.py", line 159, in wrapper
      return fn(*args, **kwargs)
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_run.py", line 539, in __exit__
      remaining_error_after_cancel_scope = self._close(exc)
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_run.py", line 476, in _close
      scope_task = current_task()
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_run.py", line 2271, in current_task
      raise RuntimeError("must be called from async context") from None
  RuntimeError: must be called from async context

    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))

trio/_core/tests/test_thread_cache.py::test_race_between_idle_exit_and_job_assignment
  /usr/lib/python3.8/site-packages/_pytest/threadexception.py:75: PytestUnhandledThreadExceptionWarning: Exception in thread Trio worker thread 5

  Traceback (most recent call last):
    File "/usr/lib64/python3.8/threading.py", line 932, in _bootstrap_inner
      self.run()
    File "/usr/lib64/python3.8/threading.py", line 870, in run
      self._target(*self._args, **self._kwargs)
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/_thread_cache.py", line 71, in _work
      deliver(result)
    File "/home/tkloczko/rpmbuild/BUILD/trio-0.18.0/trio/_core/tests/test_thread_cache.py", line 150, in <lambda>
      tc.start_thread_soon(lambda: None, lambda _: sys.exit())
  SystemExit

    warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))

-- Docs: https://docs.pytest.org/en/stable/warnings.html
========================================================================= short test summary info ==========================================================================
FAILED trio/_core/tests/test_asyncgen.py::test_fallback_when_no_hook_claims_it - AssertionError: assert 'ignored GeneratorExit' in ''
FAILED trio/_core/tests/test_run.py::test_simple_cancel_scope_usage_doesnt_create_cyclic_garbage - AssertionError: assert not [<frame at 0x7f7b87150950, file '/home/tklo...
FAILED trio/_core/tests/test_run.py::test_nursery_cancel_doesnt_create_cyclic_garbage - AssertionError: assert not [Error(Cancelled()), <function checkpoint.<locals>.<la...
FAILED trio/tests/test_exports.py::test_static_tool_sees_all_symbols[jedi-trio] - AttributeError: 'PosixPath' object has no attribute 'endswith'
FAILED trio/tests/test_exports.py::test_static_tool_sees_all_symbols[jedi-trio.abc] - TypeError: expected string or bytes-like object
FAILED trio/tests/test_exports.py::test_static_tool_sees_all_symbols[jedi-trio.socket] - TypeError: expected string or bytes-like object
FAILED trio/tests/test_exports.py::test_static_tool_sees_all_symbols[jedi-trio.lowlevel] - TypeError: expected string or bytes-like object
FAILED trio/tests/test_exports.py::test_static_tool_sees_all_symbols[jedi-trio.from_thread] - TypeError: expected string or bytes-like object
FAILED trio/tests/test_exports.py::test_static_tool_sees_all_symbols[jedi-trio.to_thread] - TypeError: expected string or bytes-like object
FAILED trio/tests/test_exports.py::test_static_tool_sees_all_symbols[jedi-trio.testing] - TypeError: expected string or bytes-like object
========================================================= 10 failed, 577 passed, 21 skipped, 6 warnings in 26.44s ==========================================================
@pquentin
Copy link
Member

pquentin commented Jan 20, 2021

Can you please try the 0.18.0 test dependencies to run tests? https://github.com/python-trio/trio/blob/v0.18.0/test-requirements.txt. For example, we don't support pytest 6.2.1.

@pquentin
Copy link
Member

Closing, please reopen if it still fails with the correct dependencies.

@kloczek
Copy link
Contributor Author

kloczek commented May 24, 2021

Just tested that and it looks now OK.

+ /usr/bin/python3 -Bm pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /home/tkloczko/rpmbuild/BUILD/trio-0.18.0, configfile: pyproject.toml
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, cov-2.11.1, httpbin-1.0.0, xdist-2.2.1, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, pyfakefs-4.4.0, freezegun-0.4.2, cases-3.4.6, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, flaky-3.7.0, requests-mock-1.9.2, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, hypothesis-6.13.2
collected 612 items

. .                                                                                                                                                                  [  0%]
trio/_core/tests/test_asyncgen.py .......                                                                                                                            [  1%]
trio/_core/tests/test_guest_mode.py ............                                                                                                                     [  3%]
trio/_core/tests/test_instrumentation.py ........                                                                                                                    [  4%]
trio/_core/tests/test_io.py ............................                                                                                                             [  9%]
trio/_core/tests/test_ki.py ...........                                                                                                                              [ 10%]
trio/_core/tests/test_local.py ....                                                                                                                                  [ 11%]
trio/_core/tests/test_mock_clock.py ......                                                                                                                           [ 12%]
trio/_core/tests/test_multierror.py .............ss.ss                                                                                                               [ 15%]
trio/_core/tests/test_parking_lot.py ....                                                                                                                            [ 16%]
trio/_core/tests/test_run.py .................................................................................................                                       [ 32%]
trio/_core/tests/test_thread_cache.py .....                                                                                                                          [ 32%]
trio/_core/tests/test_tutil.py .                                                                                                                                     [ 33%]
trio/_core/tests/test_unbounded_queue.py .....                                                                                                                       [ 33%]
trio/_core/tests/test_windows.py ssssss                                                                                                                              [ 34%]
trio/tests/test_abc.py ..                                                                                                                                            [ 35%]
trio/tests/test_channel.py .............                                                                                                                             [ 37%]
trio/tests/test_deprecate.py ...........                                                                                                                             [ 39%]
trio/tests/test_exports.py ................                                                                                                                          [ 41%]
trio/tests/test_file_io.py ................                                                                                                                          [ 44%]
trio/tests/test_highlevel_generic.py ..                                                                                                                              [ 44%]
trio/tests/test_highlevel_open_tcp_listeners.py ..................                                                                                                   [ 47%]
trio/tests/test_highlevel_open_tcp_stream.py ......................                                                                                                  [ 51%]
trio/tests/test_highlevel_open_unix_stream.py .....                                                                                                                  [ 52%]
trio/tests/test_highlevel_serve_listeners.py ....                                                                                                                    [ 52%]
trio/tests/test_highlevel_socket.py .......                                                                                                                          [ 53%]
trio/tests/test_highlevel_ssl_helpers.py ...                                                                                                                         [ 54%]
trio/tests/test_path.py .....................................                                                                                                        [ 60%]
trio/tests/test_scheduler_determinism.py ..                                                                                                                          [ 60%]
trio/tests/test_signals.py ........                                                                                                                                  [ 62%]
trio/tests/test_socket.py .......s........................                                                                                                           [ 67%]
trio/tests/test_ssl.py ...............................................................                                                                               [ 77%]
trio/tests/test_subprocess.py .................                                                                                                                      [ 80%]
trio/tests/test_sync.py ..................................                                                                                                           [ 85%]
trio/tests/test_testing.py ..................                                                                                                                        [ 88%]
trio/tests/test_threads.py .................................                                                                                                         [ 94%]
trio/tests/test_timeouts.py ...                                                                                                                                      [ 94%]
trio/tests/test_unix_pipes.py ...........                                                                                                                            [ 96%]
trio/tests/test_util.py ........                                                                                                                                     [ 97%]
trio/tests/test_wait_for_object.py ssss                                                                                                                              [ 98%]
trio/tests/test_windows_pipes.py ssssss                                                                                                                              [ 99%]
trio/tests/tools/test_gen_exports.py ...                                                                                                                             [100%]

========================================================================= short test summary info ==========================================================================
SKIPPED [1] trio/_core/tests/test_multierror.py:683: need IPython
SKIPPED [1] trio/_core/tests/test_multierror.py:690: need IPython
SKIPPED [1] trio/_core/tests/test_multierror.py:706: need IPython
SKIPPED [1] trio/_core/tests/test_multierror.py:729: need Ubuntu with python3-apport installed
SKIPPED [1] trio/_core/tests/test_windows.py:28: windows only
SKIPPED [1] trio/_core/tests/test_windows.py:55: windows only
SKIPPED [1] trio/_core/tests/test_windows.py:114: windows only
SKIPPED [1] trio/_core/tests/test_windows.py:148: windows only
SKIPPED [1] trio/_core/tests/test_windows.py:177: windows only
SKIPPED [1] trio/_core/tests/test_windows.py:196: windows only
SKIPPED [1] trio/tests/test_socket.py:256: windows only
SKIPPED [1] trio/tests/test_wait_for_object.py:22: windows only
SKIPPED [1] trio/tests/test_wait_for_object.py:75: windows only
SKIPPED [1] trio/tests/test_wait_for_object.py:131: windows only
SKIPPED [1] trio/tests/test_wait_for_object.py:165: windows only
SKIPPED [6] trio/tests/test_windows_pipes.py: windows only
===================================================================== 590 passed, 21 skipped in 35.85s =====================================================================

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

2 participants