assay icon indicating copy to clipboard operation
assay copied to clipboard

Add batch mode --verbose, --nocolor options and allow selecting/deselecting tests by regex patterns

Open bnavigator opened this issue 3 years ago • 0 comments

Hi,

This PR introduces 3 new features split in two and a half commits:

  1. Add the command argument -c, --nocolor to disable the tty color coding. Useful for CI logs, where the coloring control sequences look ugly, e.g. the openSUSE Build Service.
  2. Add the command argument -v, --verbose (available in batch mode only) to show which tests are running and passing instead of just a '.'
  3. Add the command family --pattern REGEX, -k REGEX and --deselect REGEX, + REGEX to filter tests by regular expressions.
$ python3 -m assay -h      
usage: assay [-h] [-b] [--pattern REGEX] [--deselect REGEX] [-v] [-c] name [name ...]

Fast testing framework

positional arguments:
  name                  directory, package, or module to test

optional arguments:
  -h, --help            show this help message and exit
  -b, --batch           run tests once, then exit with success or failure
  --pattern REGEX, -k REGEX
                        only run test functions matching the regular expression REGEX
  --deselect REGEX, +k REGEX
                        do not run test functions matching the regular expression REGEX
  -v, --verbose         be verbose in batch mode: print test names being tested
  -c, --nocolor         suppress colored printout

bnavigator avatar Jul 27 '20 22:07 bnavigator