#!/usr/bin/env bash

# Configure the amount of jobs to run in parallel to:
#   * Ratio: a quarter (1/4) of the available processor threads
#   * Minimum: 1
#   * Maximum: 8
jobs=$(( $(nproc) / 4 ))
jobs=$(( $jobs > 0 ? $jobs : 1 ))
jobs=$(( $jobs < 8 ? $jobs : 8 ))

BASH_COMPLETION_TEST_BASH_COMPLETION=/usr/share/bash-completion/bash_completion \
  pytest \
    -n $jobs \
    test/t
