You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ pytest test_.py
================================================================== test session starts ==================================================================
platform linux -- Python 3.9.7, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/jbss/tmp
plugins: typeguard-2.13.0, cov-3.0.0, lazy-fixture-0.6.3, cases-3.6.5, hydra-core-1.1.1
collected 0 items / 1 error
======================================================================== ERRORS =========================================================================
_______________________________________________________________ ERROR collecting test_.py _______________________________________________________________
too many positional arguments
The above exception was the direct cause of the following exception:
partial object functools.partial(<function MyCases.case_two_forgot_self at 0x7f4057251e50>, <test_.MyCases object at 0x7f40573359a0>) has incorrect arguments
During handling of the above exception, another exception occurred:
Could not determine arguments of functools.partial(<function MyCases.case_two_forgot_self at 0x7f4057251e50>, <test_.MyCases object at 0x7f40573359a0>): partial object functools.partial(<function MyCases.case_two_forgot_self at 0x7f4057251e50>, <test_.MyCases object at 0x7f40573359a0>) has incorrect arguments
================================================================ short test summary info ================================================================
ERROR test_.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=================================================================== 1 error in 0.10s ====================================================================
It's true that the error message does mention "incorrect arguments".
Maybe polished error messages are a lot to ask from an experimental proof-of-concept library such as this one, but I thought I'd submit this issue with the suggested improvement anyway :)
The text was updated successfully, but these errors were encountered:
* Completed fix for #243: now also with cases having parameters or requiring fixtures. Made the test only valid in python 3.
* Fixed version flag in develop mode - there was a bug due to the folder refactoring.
* Added support for the new Scopes enum in pytest 7: `fixdef.scopenum` and `callspec._arg2scopenum` are now `fixdef._scope` and `callspec._arg2scope` and contain a `Scope`. Sorting of fixture defs is now done according to the reversed order of Scope enum instances. Not yet tested with pytest-7.0.0rc1. (hopefully) Fixed#241
* Changelog 3.6.7
Co-authored-by: Sylvain MARIE <sylvain.marie@se.com>
In the following example, forgetting to pass a
self
argument to a pytest case defined in a class results in a confusing error message:The resulting error could be more clear:
It's true that the error message does mention "incorrect arguments".
Maybe polished error messages are a lot to ask from an experimental proof-of-concept library such as this one, but I thought I'd submit this issue with the suggested improvement anyway :)
The text was updated successfully, but these errors were encountered: