From 9733b1bebf4232f456d42e2f5577d5af5d5dc2cc Mon Sep 17 00:00:00 2001 From: Tibor Arpas Date: Thu, 1 Jun 2023 18:03:04 +0200 Subject: [PATCH] Change processing of ignore dependencies and bump to 2.0.9dev1 --- testmon/__init__.py | 2 +- testmon/pytest_testmon.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/testmon/__init__.py b/testmon/__init__.py index 2d578d6..e592259 100644 --- a/testmon/__init__.py +++ b/testmon/__init__.py @@ -1,2 +1,2 @@ """PYTEST_DONT_REWRITE""" -VERSION = "2.0.9dev0" +VERSION = "2.0.9dev1" diff --git a/testmon/pytest_testmon.py b/testmon/pytest_testmon.py index 9924e2a..01ee721 100644 --- a/testmon/pytest_testmon.py +++ b/testmon/pytest_testmon.py @@ -111,7 +111,7 @@ def pytest_addoption(parser): ) parser.addini("environment_expression", "environment expression", default="") - parser.addini("ignore_dependencies", "ignore dependencies", default=[]) + parser.addini("testmon_ignore_dependencies", "ignore dependencies", default=[]) parser.addini("testmon_url", "URL of the testmon.net api server.") parser.addini("tmnet_api_key", "testmon api key") @@ -132,10 +132,14 @@ def init_testmon_data(config): environment = config.getoption("environment_expression") or eval_environment( config.getini("environment_expression") ) - ignore_dependencies_str = config.getini("ignore_dependencies") - ignore_dependencies = ( - ignore_dependencies_str.split("\n") if ignore_dependencies_str else None - ) + ignore_dependencies_arg = config.getini("testmon_ignore_dependencies") + if type(ignore_dependencies_arg) in (list, tuple): + ignore_dependencies = ignore_dependencies_arg + elif ignore_dependencies_arg and "\n" in ignore_dependencies_arg: + ignore_dependencies = ignore_dependencies_arg.split("\n") + else: + ignore_dependencies = ignore_dependencies_arg + system_packages = get_system_packages(ignore=ignore_dependencies) url = config.getini("testmon_url")