We use a combination of dynamic (ddt) tests and vcr-unittest, which records HTTP requests and replays them when tests are rerun. This is all well and good, but we bump into an issue:
- Tests are given names based on arguments plus an ordinal integer
- Our set of arguments is always unique, so the integer is not necessary
- When tests are run,
vcr saves them based on test name with the ordinal
- When a new test gets added, all the ordinals get changed, causing git armageddon on hundreds of files with slight changes
It would therefore be awesome if we could specify that we do not want ordinal numbers appended:
@data(*datapoints, ordinal=False)
def f(x, y, z):
pass
The argument name could be anything, ordinal, suppress_ordinal, or even unique=True, meaning that all test names are unique and thus that ordinals aren't necessary.
Currently we just monkey patch mk_test_name, but shouldn't do this because it causes other issues later.
We use a combination of dynamic (ddt) tests and
vcr-unittest, which records HTTP requests and replays them when tests are rerun. This is all well and good, but we bump into an issue:vcrsaves them based on test name with the ordinalIt would therefore be awesome if we could specify that we do not want ordinal numbers appended:
The argument name could be anything,
ordinal,suppress_ordinal, or evenunique=True, meaning that all test names are unique and thus that ordinals aren't necessary.Currently we just monkey patch
mk_test_name, but shouldn't do this because it causes other issues later.