Hello.
I'm having an issue with Pytest where I'm unable to run parameterized tests with custom class objects.
Script path: ...\AppData\Local\Programs\Python\Python314\Lib\site-packages_pytest\python.py
Lineno: 1052
Error:
1052: in _idval_from_value
elif isinstance(getattr(val, "__name__", None), str):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E KeyError: '__name__'
(don't know why the above text is big and bold)
I should note that on my side, the test that now is unable to run had passed before about one week ago, and nothing has changed within the test script itself.
It seems to be that my custom class, which is basically a wrapper around the Python Dict builtin class, causes the error to now raise, whereas if I convert this to a normal python Dict, the tests passes again.
Hello.
I'm having an issue with Pytest where I'm unable to run parameterized tests with custom class objects.
Script path: ...\AppData\Local\Programs\Python\Python314\Lib\site-packages_pytest\python.py
Lineno: 1052
Error:
1052: in _idval_from_value
elif isinstance(getattr(val, "__name__", None), str):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E KeyError: '__name__'
(don't know why the above text is big and bold)
I should note that on my side, the test that now is unable to run had passed before about one week ago, and nothing has changed within the test script itself.
It seems to be that my custom class, which is basically a wrapper around the Python Dict builtin class, causes the error to now raise, whereas if I convert this to a normal python Dict, the tests passes again.