Usage

1
2
# Run help
!python src.py -h
usage: pytest [-h] [-v] [-l] [-o LOG_FILE] {create,remove,list} ...

App Description goes here.

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         verbose output (default: False)
  -l, --log
  -o LOG_FILE, --log-file LOG_FILE
                        name of the log file to write output (default: None)

commands:
  {create,remove,list}
    create              Create new test.
    remove              Remove a test.
    list                List all tests.

1
2
# Run `create` help
!python src.py create -h
usage: pytest create [-h] name

Create new test.

positional arguments:
  name        Name of the test

optional arguments:
  -h, --help  show this help message and exit

1
2
# Run `remove` help
!python src.py remove -h
usage: pytest remove [-h] name

Remove a test.

positional arguments:
  name        Name of the test

optional arguments:
  -h, --help  show this help message and exit

1
2
# Run `list` help
!python src.py list -h
usage: pytest list [-h] [filter]

List all tests.

positional arguments:
  filter

optional arguments:
  -h, --help  show this help message and exit

1
2
# Run `create` command
!python src.py create folder1
log (<class 'bool'>): False
log_file (<class 'NoneType'>): None
name (<class 'str'>): folder1
verbose (<class 'bool'>): False

1
2
# Run `remove` command
!python src.py remove folder1
log (<class 'bool'>): False
log_file (<class 'NoneType'>): None
name (<class 'str'>): folder1
verbose (<class 'bool'>): False

1
2
# Run `list` command
!python src.py list
container (<class 'list'>): []
filter (<class 'NoneType'>): None
log (<class 'bool'>): False
log_file (<class 'NoneType'>): None
verbose (<class 'bool'>): False

1
!python src.py --log-file file.log list
container (<class 'list'>): []
filter (<class 'NoneType'>): None
log (<class 'bool'>): False
log_file (<class 'str'>): file.log
verbose (<class 'bool'>): False

1
!python src.py --log-file file.log list filterme
container (<class 'list'>): []
filter (<class 'str'>): filterme
log (<class 'bool'>): False
log_file (<class 'str'>): file.log
verbose (<class 'bool'>): False