From 242d91e20782a1167f848696fec1b980d5b0ac8d Mon Sep 17 00:00:00 2001 From: Jon Bringhurst Date: Sun, 29 Jan 2023 12:55:32 -0800 Subject: [PATCH] chore(test): add a 3min timeout to each individual tests and enable color output --- constraints.txt | 1 + pyproject.toml | 4 +++- setup.cfg | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/constraints.txt b/constraints.txt index 42c8b145..65926fcd 100644 --- a/constraints.txt +++ b/constraints.txt @@ -5,3 +5,4 @@ flake8==5.0.2 objgraph==3.5.0 pytest==6.2.5 pytest-cov==3.0.0 +pytest-timeout==2.2.0 diff --git a/pyproject.toml b/pyproject.toml index f474736c..db3890c5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,11 +20,13 @@ extend-exclude = ''' ''' [tool.pytest.ini_options] -addopts = "-ra -v" +addopts = "-ra -v --color=yes" log_cli = true log_cli_date_format = "%Y-%m-%d %H:%M:%S" log_cli_format = "%(asctime)s %(levelname)s %(message)s" log_cli_level = "INFO" +# Per-test timeout in seconds +timeout = 180 [tool.mypy] diff --git a/setup.cfg b/setup.cfg index e1a9faac..e110a3b5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -58,6 +58,7 @@ test = objgraph pytest pytest-cov + pytest-timeout gevent>=1.2 ; implementation_name!='pypy' eventlet>=0.17.1 ; implementation_name!='pypy' pyjks