Closed 12rambau closed 8 months ago
Hi @12rambau,
TBH I think the check
methods already have too many options/switches as it is.
I usually don't mind using a custom basename, say basename="something_data1"
; the default being the test name is useful but not always a good choice because you might rename the test, and then you have to regenerate the files just because of that.
A little more verbose, but you can use the request
fixture like this:
def test_something(data_regression, request):
data_regression.check(data1, basename=f"{request.node.name}_data1")
data_regression.check(data2, basename=f"{request.node.name}_data2")
I think this is a good compromise.
That is an excellent compromise, let's leave this open I would like to document it in an admonition somewhere
OK. thanks, appreciate it!
Most of the time when I need to use "basename parameter" I in fact just want to test 2 things in the same test (yes I know it's not best practice but I have some legit reasons).
Instead of writting down the whole basename I would like to keep the original one which is my test name and simply add a suffix to it.
something like:
Which would create a
test_something_data1.yml
and atest_something_data2.yml
files. Do you think it would make sense to add it to the plugin ?