diff --git a/datadog_checks_dev/CHANGELOG.md b/datadog_checks_dev/CHANGELOG.md index 55b420c9eccb7..dc55aed849566 100644 --- a/datadog_checks_dev/CHANGELOG.md +++ b/datadog_checks_dev/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +***Fixed***: + +* Stop using the TOX_ENV_NAME variable ([#15528](https://github.com/DataDog/integrations-core/pull/15528)) + ## 23.0.0 / 2023-08-10 ***Changed***: diff --git a/datadog_checks_dev/datadog_checks/dev/plugin/pytest.py b/datadog_checks_dev/datadog_checks/dev/plugin/pytest.py index 80745fbe81bf2..4cbdaefd6ab68 100644 --- a/datadog_checks_dev/datadog_checks/dev/plugin/pytest.py +++ b/datadog_checks_dev/datadog_checks/dev/plugin/pytest.py @@ -160,7 +160,7 @@ def run_check(config=None, **kwargs): root = new_root python_path = os.environ[E2E_PARENT_PYTHON] - env = os.environ.get('TOX_ENV_NAME') or os.environ['HATCH_ENV_ACTIVE'] + env = os.environ['HATCH_ENV_ACTIVE'] # TODO: switch to `ddev` when the old CLI is gone check_command = [python_path, '-m', 'datadog_checks.dev', 'env', 'check', check, env, '--json'] diff --git a/datadog_checks_dev/datadog_checks/dev/tooling/testing.py b/datadog_checks_dev/datadog_checks/dev/tooling/testing.py index 1e360e48f2d1c..04853517f04c6 100644 --- a/datadog_checks_dev/datadog_checks/dev/tooling/testing.py +++ b/datadog_checks_dev/datadog_checks/dev/tooling/testing.py @@ -553,9 +553,7 @@ def construct_pytest_options( # junit report file must contain the env name to handle multiple envs # $HATCH_ENV_ACTIVE is a Hatch injected variable # See https://hatch.pypa.io/latest/plugins/environment/reference/#hatch.env.plugin.interface.EnvironmentInterface.get_env_vars # noqa - # $TOX_ENV_NAME is a tox injected variable - # See https://tox.readthedocs.io/en/latest/config.html#injected-environment-variables - f' --junit-xml=.junit/test-{test_group}-$HATCH_ENV_ACTIVE$TOX_ENV_NAME.xml' + f' --junit-xml=.junit/test-{test_group}-$HATCH_ENV_ACTIVE.xml' # Junit test results class prefix f' --junit-prefix={check}' ) diff --git a/datadog_checks_dev/datadog_checks/dev/utils.py b/datadog_checks_dev/datadog_checks/dev/utils.py index 75f8cf2e6c755..0f093c0cb1dfc 100644 --- a/datadog_checks_dev/datadog_checks/dev/utils.py +++ b/datadog_checks_dev/datadog_checks/dev/utils.py @@ -27,7 +27,7 @@ def get_active_env(): - return os.environ.get('TOX_ENV_NAME') or os.environ['HATCH_ENV_ACTIVE'] + return os.environ['HATCH_ENV_ACTIVE'] def ensure_bytes(s):