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
Improved filtering capabilities: new glob argument, and filter callables now receive the case function. Also, the case info located at c._pytestcase is now always present, with an id even if all the defaults are used.
`get_pytest_parametrize_args` renamed `get_parametrize_args` now that returned arguments are all lazy values or fixture refs and therefore can't work with pytest parametrize.
Optional decorator for case functions so as to customize some information.
162
+
163
+
```python
164
+
@case(id='hey')
165
+
def case_hi():
166
+
return 1
167
+
```
125
168
126
169
:param id: the custom pytest id that should be used when this case is active. Replaces the deprecated `@case_name`
127
-
:param tags: custom tags to be used for filtering. Replaces the deprecated `@case_tags`
128
-
:param lru_cache:
129
-
:param marks:
170
+
decorator from v1. If no id is provided, the id is generated from case functions by removing their prefix,
171
+
see `@parametrize_with_cases(prefix='case_')`.
172
+
:param tags: custom tags to be used for filtering in `@parametrize_with_cases(has_tags)`. Replaces the deprecated
173
+
`@case_tags` and `@target` decorators.
174
+
:param marks: optional pytest marks to add on the case. Note that decorating the function directly with the mark
175
+
also works, and if marks are provided in both places they are merged.
130
176
:return:
131
177
"""
132
-
# if lru_cache:
133
-
# nb_cases = 1 # TODO change when fixture dependencies are taken into account. What about creating a dedicated independent cache decorator pytest goodie ?
134
-
# # decorate the function with the appropriate lru cache size
0 commit comments