Skip to content

test_memory_loader_fails_invalid fails on Python 3.12 #3065

@hroncok

Description

@hroncok

Issue

    def test_memory_loader_fails_invalid(value: Any, of_type: type[Any], exception: Exception, msg: str) -> None:
        loader = MemoryLoader(**{"a": value}, kwargs={})
        args = ConfigLoadArgs([], "name", None)
>       with pytest.raises(exception, match=msg):  # type: ignore[call-overload]
E       AssertionError: Regex pattern did not match.
E        Regex: 'expected str, bytes or os.PathLike object'
E        Input: "argument should be a str or an os.PathLike object where __fspath__ returns a str, not 'type'"

args       = <tox.config.loader.api.ConfigLoadArgs object at 0x7f17242dfa40>
exception  = <class 'TypeError'>
loader     = MemoryLoader
msg        = 'expected str, bytes or os.PathLike object'
of_type    = <class 'pathlib.Path'>
value      = <class 'object'>

tests/config/loader/test_memory_loader.py:77: AssertionError

Environment

  • OS: Fedora 39

I will submit a pull request

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions