Skip to content

Disable ordinal numbering of tests with a decorator argument #61

@interrogator

Description

@interrogator

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:

  1. Tests are given names based on arguments plus an ordinal integer
  2. Our set of arguments is always unique, so the integer is not necessary
  3. When tests are run, vcr saves them based on test name with the ordinal
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions