Exemple #1
0
    def test_dd_env(self):
        c = Config()
        assert c.env is None

        with override_env(dict(DD_ENV="prod")):
            c = Config()
            assert c.env == "prod"

            # manual override still possible
            c.env = "prod-staging"
            assert c.env == "prod-staging"
Exemple #2
0
    def test_dd_env(self):
        c = Config()
        assert c.env is None

        with override_env(dict(DD_ENV="prod")):
            c = Config()
            assert c.env == "prod"

            # manual override still possible
            c.env = "prod-staging"
            assert c.env == "prod-staging"

        # between DD_ENV and DATADOG_ENV, the former takes priority
        with override_env(dict(DATADOG_ENV="prod", DD_ENV="prod-staging")):
            c = Config()
            assert c.env == "prod-staging"