diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6b153cb0..3079e444 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,12 +32,12 @@ jobs: - "providers/openfeature-provider-ofrep" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: submodules: recursive - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 with: python-version: ${{ matrix.python-version }} cache: "pip" @@ -60,7 +60,7 @@ jobs: - if: matrix.python-version == '3.11' name: Upload coverage to Codecov - uses: codecov/codecov-action@v4.5.0 + uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2 with: name: Code Coverage for ${{ matrix.package }} on Python ${{ matrix.python-version }} directory: ${{ matrix.package }} @@ -72,14 +72,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 with: python-version: "3.11" cache: "pip" - name: Run pre-commit - uses: pre-commit/action@v3.0.1 + uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 sast: runs-on: ubuntu-latest @@ -88,13 +88,13 @@ jobs: contents: read security-events: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3 with: languages: python config-file: ./.github/codeql-config.yml - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3 diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml index c2f9a9aa..304758cc 100644 --- a/.github/workflows/lint-pr.yml +++ b/.github/workflows/lint-pr.yml @@ -20,12 +20,12 @@ jobs: name: Validate PR title runs-on: ubuntu-latest steps: - - uses: amannn/action-semantic-pull-request@v5 + - uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5 id: lint_pr_title env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: marocchino/sticky-pull-request-comment@v2 + - uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2 # When the previous steps fails, the workflow would stop. By adding this # condition you can continue the execution with the populated error message. if: always() && (steps.lint_pr_title.outputs.error_message != null) @@ -44,7 +44,7 @@ jobs: # Delete a previous comment when the issue has been resolved - if: ${{ steps.lint_pr_title.outputs.error_message == null }} - uses: marocchino/sticky-pull-request-comment@v2 + uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2 with: header: pr-title-lint-error delete: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 497ddb1d..8c009f96 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: pull-requests: write # for googleapis/release-please-action to create release PR # Release-please creates a PR that tracks all changes steps: - - uses: googleapis/release-please-action@v4 + - uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4 id: release with: token: ${{secrets.GITHUB_TOKEN}} @@ -46,10 +46,10 @@ jobs: # IMPORTANT: this permission is mandatory for trusted publishing to pypi id-token: write container: - image: "python:3.12" + image: "python:3.13" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: submodules: recursive diff --git a/.gitmodules b/.gitmodules index 466f2596..8b2e2518 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,6 +4,7 @@ [submodule "providers/openfeature-provider-flagd/test-harness"] path = providers/openfeature-provider-flagd/openfeature/test-harness url = git@github.com:open-feature/flagd-testbed.git + branch = v0.5.18 [submodule "providers/openfeature-provider-flagd/spec"] path = providers/openfeature-provider-flagd/openfeature/spec url = https://github.com/open-feature/spec diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9b08fdba..16eb005e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,14 +1,14 @@ default_stages: [commit] repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.3 + rev: v0.8.4 hooks: - id: ruff args: [--fix] - id: ruff-format - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: check-toml - id: check-yaml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8db34176..583f262f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,7 +30,13 @@ We use `pytest` for our unit testing, making use of `parametrized` to inject cas ### Integration tests -These are planned once the SDK has been stabilized and a Flagd provider implemented. At that point, we will utilize the [gherkin integration tests](https://github.com/open-feature/test-harness/blob/main/features/evaluation.feature) to validate against a live, seeded Flagd instance. +The Flagd provider utilizes the [gherkin integration tests](https://github.com/open-feature/test-harness/blob/main/features/evaluation.feature) to validate against a live, seeded Flagd instance. + +To run the integration tests you need to have a container runtime, like docker, ranger, etc. installed. + +```bash +hatch run test +``` ### Type checking @@ -52,6 +58,13 @@ Navigate to the repository folder cd python-sdk-contrib ``` +Checkout submodules + +```bash +git submodule update --init --recursive +``` + + Add your fork as an origin ```bash @@ -62,7 +75,8 @@ Ensure your development environment is all set up by building and testing ```bash cd -hatch run test +hatch build +hatch test ``` To start working on a new feature or bugfix, create a new branch and start working on it. @@ -70,7 +84,7 @@ To start working on a new feature or bugfix, create a new branch and start worki ```bash git checkout -b feat/NAME_OF_FEATURE # Make your changes -git commit +git commit -s -m "feat: my feature" git push fork feat/NAME_OF_FEATURE ``` diff --git a/providers/openfeature-provider-flagd/README.md b/providers/openfeature-provider-flagd/README.md index 6833da0c..c657b988 100644 --- a/providers/openfeature-provider-flagd/README.md +++ b/providers/openfeature-provider-flagd/README.md @@ -1,6 +1,7 @@ # flagd Provider for OpenFeature -This provider is designed to use flagd's [evaluation protocol](https://github.com/open-feature/schemas/blob/main/protobuf/schema/v1/schema.proto). +This provider is designed to use +flagd's [evaluation protocol](https://github.com/open-feature/schemas/blob/main/protobuf/schema/v1/schema.proto). ## Installation @@ -29,7 +30,34 @@ api.set_provider(FlagdProvider()) ### In-process resolver -This mode performs flag evaluations locally (in-process). +This mode performs flag evaluations locally (in-process). Flag configurations for evaluation are obtained via gRPC protocol using [sync protobuf schema](https://buf.build/open-feature/flagd/file/main:sync/v1/sync_service.proto) service definition. + +Consider the following example to create a `FlagdProvider` with in-process evaluations, + +```python +from openfeature import api +from openfeature.contrib.provider.flagd import FlagdProvider +from openfeature.contrib.provider.flagd.config import ResolverType + +api.set_provider(FlagdProvider( + resolver_type=ResolverType.IN_PROCESS, +)) +``` + +In the above example, in-process handlers attempt to connect to a sync service on address `localhost:8013` to obtain [flag definitions](https://github.com/open-feature/schemas/blob/main/json/flags.json). + + +#### Offline mode + +In-process resolvers can also work in an offline mode. +To enable this mode, you should provide a valid flag configuration file with the option `offlineFlagSourcePath`. ```python from openfeature import api @@ -42,16 +70,21 @@ api.set_provider(FlagdProvider( )) ``` +Provider will attempt to detect file changes using polling. +Polling happens at 5 second intervals and this is currently unconfigurable. +This mode is useful for local development, tests and offline applications. + ### Configuration options The default options can be defined in the FlagdProvider constructor. | Option name | Environment variable name | Type & Values | Default | Compatible resolver | -| ------------------------ | ------------------------------ | -------------------------- | ----------------------------- | ------------------- | +|--------------------------|--------------------------------|----------------------------|-------------------------------|---------------------| | resolver_type | FLAGD_RESOLVER | enum - `rpc`, `in-process` | rpc | | | host | FLAGD_HOST | str | localhost | rpc & in-process | | port | FLAGD_PORT | int | 8013 (rpc), 8015 (in-process) | rpc & in-process | | tls | FLAGD_TLS | bool | false | rpc & in-process | +| cert_path | FLAGD_SERVER_CERT_PATH | String | null | rpc & in-process | | deadline | FLAGD_DEADLINE_MS | int | 500 | rpc & in-process | | stream_deadline_ms | FLAGD_STREAM_DEADLINE_MS | int | 600000 | rpc & in-process | | keep_alive_time | FLAGD_KEEP_ALIVE_TIME_MS | int | 0 | rpc & in-process | @@ -64,8 +97,6 @@ The default options can be defined in the FlagdProvider constructor. @@ -100,17 +131,18 @@ and the evaluation will default. TLS is available in situations where flagd is running on another host. - ## License diff --git a/providers/openfeature-provider-flagd/openfeature/schemas b/providers/openfeature-provider-flagd/openfeature/schemas index 76d611fd..4ed5eccc 160000 --- a/providers/openfeature-provider-flagd/openfeature/schemas +++ b/providers/openfeature-provider-flagd/openfeature/schemas @@ -1 +1 @@ -Subproject commit 76d611fd94689d906af316105ac12670d40f7648 +Subproject commit 4ed5ecccc8f546e6e6ff2928596be71515ad4813 diff --git a/providers/openfeature-provider-flagd/openfeature/test-harness b/providers/openfeature-provider-flagd/openfeature/test-harness index e132d258..706a7e95 160000 --- a/providers/openfeature-provider-flagd/openfeature/test-harness +++ b/providers/openfeature-provider-flagd/openfeature/test-harness @@ -1 +1 @@ -Subproject commit e132d25822eaad367f81cf2a06b422edac32a76d +Subproject commit 706a7e951bb72a145523b38fe83060becc34c4d7 diff --git a/providers/openfeature-provider-flagd/pyproject.toml b/providers/openfeature-provider-flagd/pyproject.toml index 738ba02a..bca7f949 100644 --- a/providers/openfeature-provider-flagd/pyproject.toml +++ b/providers/openfeature-provider-flagd/pyproject.toml @@ -40,7 +40,7 @@ dependencies = [ "pytest-bdd", "testcontainers", "asserts", - "grpcio-health-checking==1.60.0", + "grpcio-health-checking==1.68.1", ] pre-install-commands = [ "hatch build", diff --git a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/config.py b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/config.py index bcd4da85..a130790e 100644 --- a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/config.py +++ b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/config.py @@ -26,9 +26,10 @@ class CacheType(Enum): DEFAULT_RESOLVER_TYPE = ResolverType.RPC DEFAULT_RETRY_BACKOFF = 1000 DEFAULT_RETRY_BACKOFF_MAX = 120000 -DEFAULT_RETRY_GRACE_ATTEMPTS = 5 +DEFAULT_RETRY_GRACE_PERIOD_SECONDS = 5 DEFAULT_STREAM_DEADLINE = 600000 DEFAULT_TLS = False +DEFAULT_TLS_CERT: typing.Optional[str] = None ENV_VAR_CACHE_SIZE = "FLAGD_MAX_CACHE_SIZE" ENV_VAR_CACHE_TYPE = "FLAGD_CACHE" @@ -41,9 +42,11 @@ class CacheType(Enum): ENV_VAR_RESOLVER_TYPE = "FLAGD_RESOLVER" ENV_VAR_RETRY_BACKOFF_MS = "FLAGD_RETRY_BACKOFF_MS" ENV_VAR_RETRY_BACKOFF_MAX_MS = "FLAGD_RETRY_BACKOFF_MAX_MS" -ENV_VAR_RETRY_GRACE_ATTEMPTS = "FLAGD_RETRY_GRACE_ATTEMPTS" +ENV_VAR_RETRY_GRACE_PERIOD_SECONDS = "FLAGD_RETRY_GRACE_PERIOD" +ENV_VAR_SELECTOR = "FLAGD_SOURCE_SELECTOR" ENV_VAR_STREAM_DEADLINE_MS = "FLAGD_STREAM_DEADLINE_MS" ENV_VAR_TLS = "FLAGD_TLS" +ENV_VAR_TLS_CERT = "FLAGD_SERVER_CERT_PATH" T = typing.TypeVar("T") @@ -76,17 +79,19 @@ def __init__( # noqa: PLR0913 host: typing.Optional[str] = None, port: typing.Optional[int] = None, tls: typing.Optional[bool] = None, + selector: typing.Optional[str] = None, resolver: typing.Optional[ResolverType] = None, offline_flag_source_path: typing.Optional[str] = None, offline_poll_interval_ms: typing.Optional[int] = None, retry_backoff_ms: typing.Optional[int] = None, retry_backoff_max_ms: typing.Optional[int] = None, - retry_grace_attempts: typing.Optional[int] = None, + retry_grace_period: typing.Optional[int] = None, deadline_ms: typing.Optional[int] = None, stream_deadline_ms: typing.Optional[int] = None, keep_alive_time: typing.Optional[int] = None, cache: typing.Optional[CacheType] = None, max_cache_size: typing.Optional[int] = None, + cert_path: typing.Optional[str] = None, ): self.host = env_or_default(ENV_VAR_HOST, DEFAULT_HOST) if host is None else host @@ -115,14 +120,16 @@ def __init__( # noqa: PLR0913 else retry_backoff_max_ms ) - self.retry_grace_attempts: int = ( + self.retry_grace_period: int = ( int( env_or_default( - ENV_VAR_RETRY_GRACE_ATTEMPTS, DEFAULT_RETRY_GRACE_ATTEMPTS, cast=int + ENV_VAR_RETRY_GRACE_PERIOD_SECONDS, + DEFAULT_RETRY_GRACE_PERIOD_SECONDS, + cast=int, ) ) - if retry_grace_attempts is None - else retry_grace_attempts + if retry_grace_period is None + else retry_grace_period ) self.resolver = ( @@ -198,3 +205,13 @@ def __init__( # noqa: PLR0913 if max_cache_size is None else max_cache_size ) + + self.cert_path = ( + env_or_default(ENV_VAR_TLS_CERT, DEFAULT_TLS_CERT) + if cert_path is None + else cert_path + ) + + self.selector = ( + env_or_default(ENV_VAR_SELECTOR, None) if selector is None else selector + ) diff --git a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py index 07e148e1..01f483b2 100644 --- a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py +++ b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py @@ -46,6 +46,7 @@ def __init__( # noqa: PLR0913 deadline: typing.Optional[int] = None, timeout: typing.Optional[int] = None, retry_backoff_ms: typing.Optional[int] = None, + selector: typing.Optional[str] = None, resolver_type: typing.Optional[ResolverType] = None, offline_flag_source_path: typing.Optional[str] = None, stream_deadline_ms: typing.Optional[int] = None, @@ -53,7 +54,8 @@ def __init__( # noqa: PLR0913 cache_type: typing.Optional[CacheType] = None, max_cache_size: typing.Optional[int] = None, retry_backoff_max_ms: typing.Optional[int] = None, - retry_grace_attempts: typing.Optional[int] = None, + retry_grace_period: typing.Optional[int] = None, + cert_path: typing.Optional[str] = None, ): """ Create an instance of the FlagdProvider @@ -84,13 +86,15 @@ def __init__( # noqa: PLR0913 deadline_ms=deadline, retry_backoff_ms=retry_backoff_ms, retry_backoff_max_ms=retry_backoff_max_ms, - retry_grace_attempts=retry_grace_attempts, + retry_grace_period=retry_grace_period, + selector=selector, resolver=resolver_type, offline_flag_source_path=offline_flag_source_path, stream_deadline_ms=stream_deadline_ms, keep_alive_time=keep_alive_time, cache=cache_type, max_cache_size=max_cache_size, + cert_path=cert_path, ) self.resolver = self.setup_resolver() @@ -105,7 +109,13 @@ def setup_resolver(self) -> AbstractResolver: self.emit_provider_configuration_changed, ) elif self.config.resolver == ResolverType.IN_PROCESS: - return InProcessResolver(self.config, self) + return InProcessResolver( + self.config, + self.emit_provider_ready, + self.emit_provider_error, + self.emit_provider_stale, + self.emit_provider_configuration_changed, + ) else: raise ValueError( f"`resolver_type` parameter invalid: {self.config.resolver}" diff --git a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/__init__.py b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/__init__.py index 73923abb..f539de8f 100644 --- a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/__init__.py +++ b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/__init__.py @@ -1,51 +1,5 @@ -import typing - -from openfeature.evaluation_context import EvaluationContext -from openfeature.flag_evaluation import FlagResolutionDetails - from .grpc import GrpcResolver from .in_process import InProcessResolver - - -class AbstractResolver(typing.Protocol): - def initialize(self, evaluation_context: EvaluationContext) -> None: ... - - def shutdown(self) -> None: ... - - def resolve_boolean_details( - self, - key: str, - default_value: bool, - evaluation_context: typing.Optional[EvaluationContext] = None, - ) -> FlagResolutionDetails[bool]: ... - - def resolve_string_details( - self, - key: str, - default_value: str, - evaluation_context: typing.Optional[EvaluationContext] = None, - ) -> FlagResolutionDetails[str]: ... - - def resolve_float_details( - self, - key: str, - default_value: float, - evaluation_context: typing.Optional[EvaluationContext] = None, - ) -> FlagResolutionDetails[float]: ... - - def resolve_integer_details( - self, - key: str, - default_value: int, - evaluation_context: typing.Optional[EvaluationContext] = None, - ) -> FlagResolutionDetails[int]: ... - - def resolve_object_details( - self, - key: str, - default_value: typing.Union[dict, list], - evaluation_context: typing.Optional[EvaluationContext] = None, - ) -> FlagResolutionDetails[typing.Union[dict, list]]: ... - +from .protocol import AbstractResolver __all__ = ["AbstractResolver", "GrpcResolver", "InProcessResolver"] diff --git a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/grpc.py b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/grpc.py index 3c260156..cb345776 100644 --- a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/grpc.py +++ b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/grpc.py @@ -7,6 +7,7 @@ from cachebox import BaseCacheImpl, LRUCache from google.protobuf.json_format import MessageToDict from google.protobuf.struct_pb2 import Struct +from grpc import ChannelConnectivity from openfeature.evaluation_context import EvaluationContext from openfeature.event import ProviderEventDetails @@ -47,6 +48,7 @@ def __init__( [ProviderEventDetails], None ], ): + self.active = False self.config = config self.emit_provider_ready = emit_provider_ready self.emit_provider_error = emit_provider_error @@ -57,26 +59,46 @@ def __init__( if self.config.cache == CacheType.LRU else None ) - self.stub, self.channel = self._create_stub() - self.retry_backoff_seconds = config.retry_backoff_ms * 0.001 - self.retry_backoff_max_seconds = config.retry_backoff_ms * 0.001 - self.retry_grace_attempts = config.retry_grace_attempts + + self.retry_grace_period = config.retry_grace_period self.streamline_deadline_seconds = config.stream_deadline_ms * 0.001 self.deadline = config.deadline_ms * 0.001 self.connected = False + self.channel = self._generate_channel(config) + self.stub = evaluation_pb2_grpc.ServiceStub(self.channel) + + self.thread: typing.Optional[threading.Thread] = None + self.timer: typing.Optional[threading.Timer] = None + + self.start_time = time.time() + + def _generate_channel(self, config: Config) -> grpc.Channel: + target = f"{config.host}:{config.port}" + # Create the channel with the service config + options = [ + ("grpc.keepalive_time_ms", config.keep_alive_time), + ("grpc.initial_reconnect_backoff_ms", config.retry_backoff_ms), + ("grpc.max_reconnect_backoff_ms", config.retry_backoff_max_ms), + ("grpc.min_reconnect_backoff_ms", config.deadline_ms), + ] + if config.tls: + channel_args = { + "options": options, + "credentials": grpc.ssl_channel_credentials(), + } + if config.cert_path: + with open(config.cert_path, "rb") as f: + channel_args["credentials"] = grpc.ssl_channel_credentials(f.read()) + + channel = grpc.secure_channel(target, **channel_args) - def _create_stub( - self, - ) -> typing.Tuple[evaluation_pb2_grpc.ServiceStub, grpc.Channel]: - config = self.config - channel_factory = grpc.secure_channel if config.tls else grpc.insecure_channel - channel = channel_factory( - f"{config.host}:{config.port}", - options=(("grpc.keepalive_time_ms", config.keep_alive_time),), - ) - stub = evaluation_pb2_grpc.ServiceStub(channel) + else: + channel = grpc.insecure_channel( + target, + options=options, + ) - return stub, channel + return channel def initialize(self, evaluation_context: EvaluationContext) -> None: self.connect() @@ -89,11 +111,12 @@ def shutdown(self) -> None: def connect(self) -> None: self.active = True - self.thread = threading.Thread( - target=self.listen, daemon=True, name="FlagdGrpcServiceWorkerThread" - ) - self.thread.start() + # Run monitoring in a separate thread + self.monitor_thread = threading.Thread( + target=self.monitor, daemon=True, name="FlagdGrpcServiceMonitorThread" + ) + self.monitor_thread.start() ## block until ready or deadline reached timeout = self.deadline + time.time() while not self.connected and time.time() < timeout: @@ -105,32 +128,72 @@ def connect(self) -> None: "Blocking init finished before data synced. Consider increasing startup deadline to avoid inconsistent evaluations." ) + def monitor(self) -> None: + self.channel.subscribe(self._state_change_callback, try_to_connect=True) + + def _state_change_callback(self, new_state: ChannelConnectivity) -> None: + logger.debug(f"gRPC state change: {new_state}") + if new_state == ChannelConnectivity.READY: + if not self.thread or not self.thread.is_alive(): + self.thread = threading.Thread( + target=self.listen, + daemon=True, + name="FlagdGrpcServiceWorkerThread", + ) + self.thread.start() + + if self.timer and self.timer.is_alive(): + logger.debug("gRPC error timer expired") + self.timer.cancel() + + elif new_state == ChannelConnectivity.TRANSIENT_FAILURE: + # this is the failed reconnect attempt so we are going into stale + self.emit_provider_stale( + ProviderEventDetails( + message="gRPC sync disconnected, reconnecting", + ) + ) + self.start_time = time.time() + # adding a timer, so we can emit the error event after time + self.timer = threading.Timer(self.retry_grace_period, self.emit_error) + + logger.debug("gRPC error timer started") + self.timer.start() + self.connected = False + + def emit_error(self) -> None: + logger.debug("gRPC error emitted") + if self.cache: + self.cache.clear() + self.emit_provider_error( + ProviderEventDetails( + message="gRPC sync disconnected, reconnecting", + error_code=ErrorCode.GENERAL, + ) + ) + def listen(self) -> None: - retry_delay = self.retry_backoff_seconds + logger.debug("gRPC starting listener thread") call_args = ( {"timeout": self.streamline_deadline_seconds} if self.streamline_deadline_seconds > 0 else {} ) - retry_counter = 0 - while self.active: - request = evaluation_pb2.EventStreamRequest() + call_args["wait_for_ready"] = True + request = evaluation_pb2.EventStreamRequest() + # defining a never ending loop to recreate the stream + while self.active: try: logger.debug("Setting up gRPC sync flags connection") for message in self.stub.EventStream(request, **call_args): if message.type == "provider_ready": - if not self.connected: - self.emit_provider_ready( - ProviderEventDetails( - message="gRPC sync connection established" - ) + self.connected = True + self.emit_provider_ready( + ProviderEventDetails( + message="gRPC sync connection established" ) - self.connected = True - retry_counter = 0 - # reset retry delay after successsful read - retry_delay = self.retry_backoff_seconds - + ) elif message.type == "configuration_change": data = MessageToDict(message)["data"] self.handle_changed_flags(data) @@ -138,48 +201,14 @@ def listen(self) -> None: if not self.active: logger.info("Terminating gRPC sync thread") return - except grpc.RpcError as e: - logger.error(f"SyncFlags stream error, {e.code()=} {e.details()=}") - # re-create the stub if there's a connection issue - otherwise reconnect does not work as expected - self.stub, self.channel = self._create_stub() + except grpc.RpcError as e: # noqa: PERF203 + # although it seems like this error log is not interesting, without it, the retry is not working as expected + logger.debug(f"SyncFlags stream error, {e.code()=} {e.details()=}") except ParseError: logger.exception( f"Could not parse flag data using flagd syntax: {message=}" ) - self.connected = False - self.handle_error(retry_counter, retry_delay) - - retry_delay = self.handle_retry(retry_counter, retry_delay) - - retry_counter = retry_counter + 1 - - def handle_retry(self, retry_counter: int, retry_delay: float) -> float: - if retry_counter == 0: - logger.info("gRPC sync disconnected, reconnecting immediately") - else: - logger.info(f"gRPC sync disconnected, reconnecting in {retry_delay}s") - time.sleep(retry_delay) - retry_delay = min(1.1 * retry_delay, self.retry_backoff_max_seconds) - return retry_delay - - def handle_error(self, retry_counter: int, retry_delay: float) -> None: - if retry_counter == self.retry_grace_attempts: - if self.cache: - self.cache.clear() - self.emit_provider_error( - ProviderEventDetails( - message=f"gRPC sync disconnected, reconnecting in {retry_delay}s", - error_code=ErrorCode.GENERAL, - ) - ) - elif retry_counter == 1: - self.emit_provider_stale( - ProviderEventDetails( - message=f"gRPC sync disconnected, reconnecting in {retry_delay}s", - ) - ) - def handle_changed_flags(self, data: typing.Any) -> None: changed_flags = list(data["flags"].keys()) diff --git a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py index a14dbb8c..16f46819 100644 --- a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py +++ b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py @@ -1,36 +1,48 @@ import typing from openfeature.evaluation_context import EvaluationContext +from openfeature.event import ProviderEventDetails from openfeature.exception import FlagNotFoundError, ParseError from openfeature.flag_evaluation import FlagResolutionDetails, Reason -from openfeature.provider import AbstractProvider from ..config import Config -from .process.file_watcher import FileWatcherFlagStore +from .process.connector import FlagStateConnector +from .process.connector.file_watcher import FileWatcher +from .process.connector.grpc_watcher import GrpcWatcher +from .process.flags import FlagStore from .process.targeting import targeting T = typing.TypeVar("T") class InProcessResolver: - def __init__(self, config: Config, provider: AbstractProvider): + def __init__( + self, + config: Config, + emit_provider_ready: typing.Callable[[ProviderEventDetails], None], + emit_provider_error: typing.Callable[[ProviderEventDetails], None], + emit_provider_stale: typing.Callable[[ProviderEventDetails], None], + emit_provider_configuration_changed: typing.Callable[ + [ProviderEventDetails], None + ], + ): self.config = config - self.provider = provider - if not self.config.offline_flag_source_path: - raise ValueError( - "offline_flag_source_path must be provided when using in-process resolver" + self.flag_store = FlagStore(emit_provider_configuration_changed) + self.connector: FlagStateConnector = ( + FileWatcher( + self.config, self.flag_store, emit_provider_ready, emit_provider_error + ) + if self.config.offline_flag_source_path + else GrpcWatcher( + self.config, self.flag_store, emit_provider_ready, emit_provider_error ) - self.flag_store = FileWatcherFlagStore( - self.config.offline_flag_source_path, - self.provider, - self.config.retry_backoff_ms * 0.001, ) def initialize(self, evaluation_context: EvaluationContext) -> None: - pass + self.connector.initialize(evaluation_context) def shutdown(self) -> None: - self.flag_store.shutdown() + self.connector.shutdown() def resolve_boolean_details( self, @@ -54,7 +66,10 @@ def resolve_float_details( default_value: float, evaluation_context: typing.Optional[EvaluationContext] = None, ) -> FlagResolutionDetails[float]: - return self._resolve(key, default_value, evaluation_context) + result = self._resolve(key, default_value, evaluation_context) + if isinstance(result.value, int): + result.value = float(result.value) + return result def resolve_integer_details( self, @@ -62,7 +77,8 @@ def resolve_integer_details( default_value: int, evaluation_context: typing.Optional[EvaluationContext] = None, ) -> FlagResolutionDetails[int]: - return self._resolve(key, default_value, evaluation_context) + result = self._resolve(key, default_value, evaluation_context) + return result def resolve_object_details( self, @@ -98,6 +114,7 @@ def _resolve( raise ParseError( "Parsed JSONLogic targeting did not return a string or bool" ) + variant, value = flag.get_variant(variant) if not value: raise ParseError(f"Resolved variant {variant} not in variants config.") diff --git a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/process/connector/__init__.py b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/process/connector/__init__.py new file mode 100644 index 00000000..07d49241 --- /dev/null +++ b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/process/connector/__init__.py @@ -0,0 +1,11 @@ +import typing + +from openfeature.evaluation_context import EvaluationContext + + +class FlagStateConnector(typing.Protocol): + def initialize( + self, evaluation_context: EvaluationContext + ) -> None: ... # pragma: no cover + + def shutdown(self) -> None: ... # pragma: no cover diff --git a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/process/connector/file_watcher.py b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/process/connector/file_watcher.py new file mode 100644 index 00000000..5a02bc82 --- /dev/null +++ b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/process/connector/file_watcher.py @@ -0,0 +1,105 @@ +import json +import logging +import os +import threading +import time +import typing + +import yaml + +from openfeature.evaluation_context import EvaluationContext +from openfeature.event import ProviderEventDetails +from openfeature.exception import ParseError, ProviderNotReadyError + +from ....config import Config +from ..connector import FlagStateConnector +from ..flags import FlagStore + +logger = logging.getLogger("openfeature.contrib") + + +class FileWatcher(FlagStateConnector): + def __init__( + self, + config: Config, + flag_store: FlagStore, + emit_provider_ready: typing.Callable[[ProviderEventDetails], None], + emit_provider_error: typing.Callable[[ProviderEventDetails], None], + ): + if config.offline_flag_source_path is None: + raise ValueError( + f"`config.offline_flag_source_path` parameter invalid: {config.offline_flag_source_path }" + ) + else: + self.file_path = config.offline_flag_source_path + + self.emit_provider_ready = emit_provider_ready + self.emit_provider_error = emit_provider_error + self.deadline_seconds = config.deadline_ms * 0.001 + + self.last_modified = 0.0 + self.flag_store = flag_store + self.should_emit_ready_on_success = False + + def initialize(self, evaluation_context: EvaluationContext) -> None: + self.active = True + self.thread = threading.Thread( + target=self.refresh_file, daemon=True, name="FlagdFileWatcherWorkerThread" + ) + self.thread.start() + + # Let this throw exceptions so that provider status is set correctly + try: + self.should_emit_ready_on_success = True + self._load_data() + except Exception as err: + raise ProviderNotReadyError from err + + def shutdown(self) -> None: + self.active = False + + def refresh_file(self) -> None: + while self.active: + time.sleep(self.deadline_seconds) + logger.debug("checking for new flag store contents from file") + self.safe_load_data() + + def safe_load_data(self) -> None: + try: + last_modified = os.path.getmtime(self.file_path) + if last_modified > self.last_modified: + self._load_data(last_modified) + except FileNotFoundError: + self.handle_error("Provided file path not valid") + except json.JSONDecodeError: + self.handle_error("Could not parse JSON flag data from file") + except yaml.error.YAMLError: + self.handle_error("Could not parse YAML flag data from file") + except ParseError: + self.handle_error("Could not parse flag data using flagd syntax") + except Exception: + self.handle_error("Could not read flags from file") + + def _load_data(self, modified_time: typing.Optional[float] = None) -> None: + with open(self.file_path) as file: + if self.file_path.endswith(".yaml"): + data = yaml.safe_load(file) + else: + data = json.load(file) + + self.flag_store.update(data) + + if self.should_emit_ready_on_success: + self.emit_provider_ready( + ProviderEventDetails( + message="Reloading file contents recovered from error state" + ) + ) + self.should_emit_ready_on_success = False + + self.last_modified = modified_time or os.path.getmtime(self.file_path) + + def handle_error(self, error_message: str) -> None: + logger.exception(error_message) + self.should_emit_ready_on_success = True + self.emit_provider_error(ProviderEventDetails(message=error_message)) diff --git a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/process/connector/grpc_watcher.py b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/process/connector/grpc_watcher.py new file mode 100644 index 00000000..a84c59da --- /dev/null +++ b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/process/connector/grpc_watcher.py @@ -0,0 +1,190 @@ +import json +import logging +import threading +import time +import typing + +import grpc + +from openfeature.evaluation_context import EvaluationContext +from openfeature.event import ProviderEventDetails +from openfeature.exception import ErrorCode, ParseError, ProviderNotReadyError +from openfeature.schemas.protobuf.flagd.sync.v1 import ( + sync_pb2, + sync_pb2_grpc, +) + +from ....config import Config +from ..connector import FlagStateConnector +from ..flags import FlagStore + +logger = logging.getLogger("openfeature.contrib") + + +class GrpcWatcher(FlagStateConnector): + def __init__( + self, + config: Config, + flag_store: FlagStore, + emit_provider_ready: typing.Callable[[ProviderEventDetails], None], + emit_provider_error: typing.Callable[[ProviderEventDetails], None], + ): + self.flag_store = flag_store + self.config = config + + self.channel = self._generate_channel(config) + self.stub = sync_pb2_grpc.FlagSyncServiceStub(self.channel) + self.retry_backoff_seconds = config.retry_backoff_ms * 0.001 + self.retry_backoff_max_seconds = config.retry_backoff_ms * 0.001 + self.retry_grace_period = config.retry_grace_period + self.streamline_deadline_seconds = config.stream_deadline_ms * 0.001 + self.deadline = config.deadline_ms * 0.001 + self.selector = config.selector + self.emit_provider_ready = emit_provider_ready + self.emit_provider_error = emit_provider_error + + self.connected = False + self.thread: typing.Optional[threading.Thread] = None + self.timer: typing.Optional[threading.Timer] = None + + self.start_time = time.time() + + def _generate_channel(self, config: Config) -> grpc.Channel: + target = f"{config.host}:{config.port}" + # Create the channel with the service config + options = [ + ("grpc.keepalive_time_ms", config.keep_alive_time), + ("grpc.initial_reconnect_backoff_ms", config.retry_backoff_ms), + ("grpc.max_reconnect_backoff_ms", config.retry_backoff_max_ms), + ("grpc.min_reconnect_backoff_ms", config.stream_deadline_ms), + ] + if config.tls: + channel_args = { + "options": options, + "credentials": grpc.ssl_channel_credentials(), + } + if config.cert_path: + with open(config.cert_path, "rb") as f: + channel_args["credentials"] = grpc.ssl_channel_credentials(f.read()) + + channel = grpc.secure_channel(target, **channel_args) + + else: + channel = grpc.insecure_channel( + target, + options=options, + ) + + return channel + + def initialize(self, context: EvaluationContext) -> None: + self.connect() + + def connect(self) -> None: + self.active = True + + # Run monitoring in a separate thread + self.monitor_thread = threading.Thread( + target=self.monitor, daemon=True, name="FlagdGrpcSyncServiceMonitorThread" + ) + self.monitor_thread.start() + ## block until ready or deadline reached + timeout = self.deadline + time.time() + while not self.connected and time.time() < timeout: + time.sleep(0.05) + logger.debug("Finished blocking gRPC state initialization") + + if not self.connected: + raise ProviderNotReadyError( + "Blocking init finished before data synced. Consider increasing startup deadline to avoid inconsistent evaluations." + ) + + def monitor(self) -> None: + self.channel.subscribe(self._state_change_callback, try_to_connect=True) + + def _state_change_callback(self, new_state: grpc.ChannelConnectivity) -> None: + logger.debug(f"gRPC state change: {new_state}") + if new_state == grpc.ChannelConnectivity.READY: + if not self.thread or not self.thread.is_alive(): + self.thread = threading.Thread( + target=self.listen, + daemon=True, + name="FlagdGrpcSyncWorkerThread", + ) + self.thread.start() + + if self.timer and self.timer.is_alive(): + logger.debug("gRPC error timer expired") + self.timer.cancel() + + elif new_state == grpc.ChannelConnectivity.TRANSIENT_FAILURE: + # this is the failed reconnect attempt so we are going into stale + self.emit_provider_stale( + ProviderEventDetails( + message="gRPC sync disconnected, reconnecting", + ) + ) + self.start_time = time.time() + # adding a timer, so we can emit the error event after time + self.timer = threading.Timer(self.retry_grace_period, self.emit_error) + + logger.debug("gRPC error timer started") + self.timer.start() + self.connected = False + + def emit_error(self) -> None: + logger.debug("gRPC error emitted") + self.emit_provider_error( + ProviderEventDetails( + message="gRPC sync disconnected, reconnecting", + error_code=ErrorCode.GENERAL, + ) + ) + + def shutdown(self) -> None: + self.active = False + self.channel.close() + + def listen(self) -> None: + call_args = ( + {"timeout": self.streamline_deadline_seconds} + if self.streamline_deadline_seconds > 0 + else {} + ) + request_args = {"selector": self.selector} if self.selector is not None else {} + + while self.active: + try: + request = sync_pb2.SyncFlagsRequest(**request_args) + + logger.debug("Setting up gRPC sync flags connection") + for flag_rsp in self.stub.SyncFlags( + request, wait_for_ready=True, **call_args + ): + flag_str = flag_rsp.flag_configuration + logger.debug( + f"Received flag configuration - {abs(hash(flag_str)) % (10 ** 8)}" + ) + self.flag_store.update(json.loads(flag_str)) + + if not self.connected: + self.emit_provider_ready( + ProviderEventDetails( + message="gRPC sync connection established" + ) + ) + self.connected = True + + if not self.active: + logger.info("Terminating gRPC sync thread") + return + except grpc.RpcError as e: # noqa: PERF203 + logger.error(f"SyncFlags stream error, {e.code()=} {e.details()=}") + except json.JSONDecodeError: + logger.exception( + f"Could not parse JSON flag data from SyncFlags endpoint: {flag_str=}" + ) + except ParseError: + logger.exception( + f"Could not parse flag data using flagd syntax: {flag_str=}" + ) diff --git a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/process/file_watcher.py b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/process/file_watcher.py deleted file mode 100644 index 0918981f..00000000 --- a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/process/file_watcher.py +++ /dev/null @@ -1,89 +0,0 @@ -import json -import logging -import os -import re -import threading -import time -import typing - -import yaml - -from openfeature.event import ProviderEventDetails -from openfeature.exception import ParseError -from openfeature.provider.provider import AbstractProvider - -from .flags import Flag - -logger = logging.getLogger("openfeature.contrib") - - -class FileWatcherFlagStore: - def __init__( - self, - file_path: str, - provider: AbstractProvider, - poll_interval_seconds: float = 1.0, - ): - self.file_path = file_path - self.provider = provider - self.poll_interval_seconds = poll_interval_seconds - - self.last_modified = 0.0 - self.flag_data: typing.Mapping[str, Flag] = {} - self.load_data() - self.thread = threading.Thread(target=self.refresh_file, daemon=True) - self.thread.start() - - def shutdown(self) -> None: - pass - - def get_flag(self, key: str) -> typing.Optional[Flag]: - return self.flag_data.get(key) - - def refresh_file(self) -> None: - while True: - time.sleep(self.poll_interval_seconds) - logger.debug("checking for new flag store contents from file") - last_modified = os.path.getmtime(self.file_path) - if last_modified > self.last_modified: - self.load_data(last_modified) - - def load_data(self, modified_time: typing.Optional[float] = None) -> None: - try: - with open(self.file_path) as file: - if self.file_path.endswith(".yaml"): - data = yaml.safe_load(file) - else: - data = json.load(file) - - self.flag_data = self.parse_flags(data) - logger.debug(f"{self.flag_data=}") - self.provider.emit_provider_configuration_changed( - ProviderEventDetails(flags_changed=list(self.flag_data.keys())) - ) - self.last_modified = modified_time or os.path.getmtime(self.file_path) - except FileNotFoundError: - logger.exception("Provided file path not valid") - except json.JSONDecodeError: - logger.exception("Could not parse JSON flag data from file") - except yaml.error.YAMLError: - logger.exception("Could not parse YAML flag data from file") - except ParseError: - logger.exception("Could not parse flag data using flagd syntax") - except Exception: - logger.exception("Could not read flags from file") - - def parse_flags(self, flags_data: dict) -> dict: - flags = flags_data.get("flags", {}) - evaluators: typing.Optional[dict] = flags_data.get("$evaluators") - if evaluators: - transposed = json.dumps(flags) - for name, rule in evaluators.items(): - transposed = re.sub( - rf"{{\s*\"\$ref\":\s*\"{name}\"\s*}}", json.dumps(rule), transposed - ) - flags = json.loads(transposed) - - if not isinstance(flags, dict): - raise ParseError("`flags` key of configuration must be a dictionary") - return {key: Flag.from_dict(key, data) for key, data in flags.items()} diff --git a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/process/flags.py b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/process/flags.py index 0354ac42..7a495e8c 100644 --- a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/process/flags.py +++ b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/process/flags.py @@ -1,9 +1,45 @@ +import json +import re import typing from dataclasses import dataclass +from openfeature.event import ProviderEventDetails from openfeature.exception import ParseError +class FlagStore: + def __init__( + self, + emit_provider_configuration_changed: typing.Callable[ + [ProviderEventDetails], None + ], + ): + self.emit_provider_configuration_changed = emit_provider_configuration_changed + self.flags: typing.Mapping[str, Flag] = {} + + def get_flag(self, key: str) -> typing.Optional["Flag"]: + return self.flags.get(key) + + def update(self, flags_data: dict) -> None: + flags = flags_data.get("flags", {}) + evaluators: typing.Optional[dict] = flags_data.get("$evaluators") + if evaluators: + transposed = json.dumps(flags) + for name, rule in evaluators.items(): + transposed = re.sub( + rf"{{\s*\"\$ref\":\s*\"{name}\"\s*}}", json.dumps(rule), transposed + ) + flags = json.loads(transposed) + + if not isinstance(flags, dict): + raise ParseError("`flags` key of configuration must be a dictionary") + self.flags = {key: Flag.from_dict(key, data) for key, data in flags.items()} + + self.emit_provider_configuration_changed( + ProviderEventDetails(flags_changed=list(self.flags.keys())) + ) + + @dataclass class Flag: key: str @@ -32,11 +68,19 @@ def __post_init__(self) -> None: @classmethod def from_dict(cls, key: str, data: dict) -> "Flag": - data["default_variant"] = data["defaultVariant"] - del data["defaultVariant"] - flag = cls(key=key, **data) + if "defaultVariant" in data: + data["default_variant"] = data["defaultVariant"] + del data["defaultVariant"] - return flag + if "source" in data: + del data["source"] + if "selector" in data: + del data["selector"] + try: + flag = cls(key=key, **data) + return flag + except Exception as err: + raise ParseError from err @property def default(self) -> typing.Tuple[str, typing.Any]: diff --git a/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/protocol.py b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/protocol.py new file mode 100644 index 00000000..c41e4e25 --- /dev/null +++ b/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/protocol.py @@ -0,0 +1,47 @@ +import typing + +from typing_extensions import Protocol + +from openfeature.evaluation_context import EvaluationContext +from openfeature.flag_evaluation import FlagResolutionDetails + + +class AbstractResolver(Protocol): + def initialize(self, evaluation_context: EvaluationContext) -> None: ... + + def shutdown(self) -> None: ... + + def resolve_boolean_details( + self, + key: str, + default_value: bool, + evaluation_context: typing.Optional[EvaluationContext] = None, + ) -> FlagResolutionDetails[bool]: ... + + def resolve_string_details( + self, + key: str, + default_value: str, + evaluation_context: typing.Optional[EvaluationContext] = None, + ) -> FlagResolutionDetails[str]: ... + + def resolve_float_details( + self, + key: str, + default_value: float, + evaluation_context: typing.Optional[EvaluationContext] = None, + ) -> FlagResolutionDetails[float]: ... + + def resolve_integer_details( + self, + key: str, + default_value: int, + evaluation_context: typing.Optional[EvaluationContext] = None, + ) -> FlagResolutionDetails[int]: ... + + def resolve_object_details( + self, + key: str, + default_value: typing.Union[dict, list], + evaluation_context: typing.Optional[EvaluationContext] = None, + ) -> FlagResolutionDetails[typing.Union[dict, list]]: ... diff --git a/providers/openfeature-provider-flagd/test_log.txt b/providers/openfeature-provider-flagd/test_log.txt new file mode 100644 index 00000000..a008e5b8 --- /dev/null +++ b/providers/openfeature-provider-flagd/test_log.txt @@ -0,0 +1,6764 @@ +============================= test session starts ============================== +platform linux -- Python 3.12.3, pytest-8.2.2, pluggy-1.5.0 +rootdir: /home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd +configfile: pyproject.toml +plugins: bdd-7.2.0 +collected 177 items + +tests/e2e/test_in-process-file.py FFFFFFFFFFF.FFFFFFFFFFFFFFFFFFFFFFFFFF [ 21%] +FFFFFFFF..FF..FFFFFFFFFFFFFFF.FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF..FF..FF [ 62%] +FF [ 63%] +tests/e2e/test_rpc.py .................................................. [ 91%] +...... [ 94%] +tests/test_config.py ... [ 96%] +tests/test_flagd.py ...... [100%] + +=================================== FAILURES =================================== +______________________ test_resolves_boolean_value[json] _______________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': True, 'key_and_default': ('boolean-flag', False)} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:180: in assert_boolean_value + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = 'False != True' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: False != True + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'boolean-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 94, in resolve_boolean_details + return self.resolver.resolve_boolean_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 49, in resolve_boolean_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key boolean-flag not present in flag store. +_______________________ test_resolves_string_value[json] _______________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': 'hi', 'key_and_default': ('string-flag', 'bye')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:317: in assert_string + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'bye' != 'hi'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'bye' != 'hi' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'string-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key string-flag not present in flag store. +______________________ test_resolves_integer_value[json] _______________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': 10, 'key_and_default': ('integer-flag', 1)} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:219: in assert_integer_value + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = '1 != 10' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 1 != 10 + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'integer-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 124, in resolve_integer_details + return self.resolver.resolve_integer_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 73, in resolve_integer_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key integer-flag not present in flag store. +_______________________ test_resolves_float_value[json] ________________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': 0.5, 'key_and_default': ('float-flag', 0.1)} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:256: in assert_float_value + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = '0.1 != 0.5' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 0.1 != 0.5 + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'float-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 114, in resolve_float_details + return self.resolver.resolve_float_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 65, in resolve_float_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key float-flag not present in flag store. +_______________________ test_resolves_object_value[json] _______________________ + +fixturefunc = +request = > +kwargs = {'bool_field': 'showImages', 'bvalue': True, 'client': , 'details': None, ...} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:383: in assert_object + assert_in(bool_field, evaluation_result) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:643: in assert_in + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'showImages' not in {}" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'showImages' not in {} + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'object-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 134, in resolve_object_details + return self.resolver.resolve_object_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 81, in resolve_object_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key object-flag not present in flag store. +_____________________ test_resolves_boolean_details[json] ______________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': True, 'key_and_default': ('boolean-flag', False), ...} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:199: in assert_boolean_value_with_details + assert_equal(evaluation_result.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = 'False != True' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: False != True + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'boolean-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 94, in resolve_boolean_details + return self.resolver.resolve_boolean_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 49, in resolve_boolean_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key boolean-flag not present in flag store. +______________________ test_resolves_string_details[json] ______________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': 'hi', 'key_and_default': ('string-flag', 'bye'), ...} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:476: in assert_string_value_with_details + assert_equal(evaluation_result.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'bye' != 'hi'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'bye' != 'hi' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'string-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key string-flag not present in flag store. +_____________________ test_resolves_integer_details[json] ______________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': 10, 'key_and_default': ('integer-flag', 1), ...} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:237: in assert_integer_value_with_details + assert_equal(evaluation_result.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = '1 != 10' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 1 != 10 + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'integer-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 124, in resolve_integer_details + return self.resolver.resolve_integer_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 73, in resolve_integer_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key integer-flag not present in flag store. +______________________ test_resolves_float_details[json] _______________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': 0.5, 'key_and_default': ('float-flag', 0.1), ...} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:274: in assert_float_value_with_details + assert_equal(evaluation_result.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = '0.1 != 0.5' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 0.1 != 0.5 + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'float-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 114, in resolve_float_details + return self.resolver.resolve_float_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 65, in resolve_float_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key float-flag not present in flag store. +______________________ test_resolves_object_details[json] ______________________ + +fixturefunc = +request = > +kwargs = {'bool_field': 'showImages', 'bvalue': True, 'client': , 'details': 'details', ...} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:374: in assert_object + assert_in(bool_field, value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:643: in assert_in + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'showImages' not in {}" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'showImages' not in {} + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'object-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 134, in resolve_object_details + return self.resolver.resolve_object_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 81, in resolve_object_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key object-flag not present in flag store. +_____________________ test_resolves_based_on_context[json] _____________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...opełk', 'age': 29, 'customer': False}), 'expected_value': 'INTERNAL', 'key_and_default': ('context-aware', 'EXTERNAL')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:333: in assert_string_response + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'EXTERNAL' != 'INTERNAL'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'EXTERNAL' != 'INTERNAL' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'context-aware' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key context-aware not present in flag store. +____________________________ test_type_error[json] _____________________________ + +fixturefunc = +request = > +kwargs = {'client': , 'error': 'TYPE_MISMATCH', 'evaluation_deta...ode=, error_message='Flag with key wrong-flag not present in flag store.')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:456: in assert_for_error + assert_equal(evaluation_details.error_code, ErrorCode[error]) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = " != " + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: != + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'wrong-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 124, in resolve_integer_details + return self.resolver.resolve_integer_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 73, in resolve_integer_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key wrong-flag not present in flag store. +__________ test_evaluator_reuse[json-"some-email-targeted-flag"-"hi"] __________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...email': 'ballmer@macrosoft.com'}), 'expected_value': 'hi', 'key_and_default': ('some-email-targeted-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'hi'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'hi' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'some-email-targeted-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key some-email-targeted-flag not present in flag store. +______ test_evaluator_reuse[json-"some-other-email-targeted-flag"-"yes"] _______ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta... 'ballmer@macrosoft.com'}), 'expected_value': 'yes', 'key_and_default': ('some-other-email-targeted-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'yes'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'yes' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'some-other-email-targeted-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key some-other-email-targeted-flag not present in flag store. +________________ test_fractional_operator[json-"jack"-"spades"] ________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...attributes={'user': {'name': 'jack'}}), 'expected_value': 'spades', 'key_and_default': ('fractional-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'spades'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'spades' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag not present in flag store. +________________ test_fractional_operator[json-"queen"-"clubs"] ________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...attributes={'user': {'name': 'queen'}}), 'expected_value': 'clubs', 'key_and_default': ('fractional-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'clubs'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'clubs' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag not present in flag store. +_______________ test_fractional_operator[json-"ten"-"diamonds"] ________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...ttributes={'user': {'name': 'ten'}}), 'expected_value': 'diamonds', 'key_and_default': ('fractional-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'diamonds'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'diamonds' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag not present in flag store. +________________ test_fractional_operator[json-"nine"-"hearts"] ________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...attributes={'user': {'name': 'nine'}}), 'expected_value': 'hearts', 'key_and_default': ('fractional-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'hearts'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'hearts' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag not present in flag store. +_________________ test_fractional_operator[json-3-"diamonds"] __________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...e, attributes={'user': {'name': 3}}), 'expected_value': 'diamonds', 'key_and_default': ('fractional-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'diamonds'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'diamonds' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag not present in flag store. +_______ test_fractional_operator_with_shared_seed[json-"jack"-"hearts"] ________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...ser': {'name': 'jack'}}), 'expected_value': 'hearts', 'key_and_default': ('fractional-flag-A-shared-seed', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'hearts'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'hearts' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag-A-shared-seed' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag-A-shared-seed not present in flag store. +_______ test_fractional_operator_with_shared_seed[json-"queen"-"spades"] _______ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...er': {'name': 'queen'}}), 'expected_value': 'spades', 'key_and_default': ('fractional-flag-A-shared-seed', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'spades'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'spades' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag-A-shared-seed' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag-A-shared-seed not present in flag store. +________ test_fractional_operator_with_shared_seed[json-"ten"-"hearts"] ________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...user': {'name': 'ten'}}), 'expected_value': 'hearts', 'key_and_default': ('fractional-flag-A-shared-seed', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'hearts'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'hearts' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag-A-shared-seed' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag-A-shared-seed not present in flag store. +______ test_fractional_operator_with_shared_seed[json-"nine"-"diamonds"] _______ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...r': {'name': 'nine'}}), 'expected_value': 'diamonds', 'key_and_default': ('fractional-flag-A-shared-seed', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'diamonds'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'diamonds' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag-A-shared-seed' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag-A-shared-seed not present in flag store. +_ test_second_fractional_operator_with_shared_seed[json-"jack"-"ace-of-hearts"] _ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...'name': 'jack'}}), 'expected_value': 'ace-of-hearts', 'key_and_default': ('fractional-flag-B-shared-seed', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'ace-of-hearts'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'ace-of-hearts' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag-B-shared-seed' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag-B-shared-seed not present in flag store. +_ test_second_fractional_operator_with_shared_seed[json-"queen"-"ace-of-spades"] _ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...name': 'queen'}}), 'expected_value': 'ace-of-spades', 'key_and_default': ('fractional-flag-B-shared-seed', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'ace-of-spades'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'ace-of-spades' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag-B-shared-seed' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag-B-shared-seed not present in flag store. +_ test_second_fractional_operator_with_shared_seed[json-"ten"-"ace-of-hearts"] _ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...{'name': 'ten'}}), 'expected_value': 'ace-of-hearts', 'key_and_default': ('fractional-flag-B-shared-seed', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'ace-of-hearts'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'ace-of-hearts' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag-B-shared-seed' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag-B-shared-seed not present in flag store. +_ test_second_fractional_operator_with_shared_seed[json-"nine"-"ace-of-diamonds"] _ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...ame': 'nine'}}), 'expected_value': 'ace-of-diamonds', 'key_and_default': ('fractional-flag-B-shared-seed', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'ace-of-diamonds'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'ace-of-diamonds' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag-B-shared-seed' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag-B-shared-seed not present in flag store. +_______________ test_substring_operators[json-"abcdef"-"prefix"] _______________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...ey=None, attributes={'id': 'abcdef'}), 'expected_value': 'prefix', 'key_and_default': ('starts-ends-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'prefix'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'prefix' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'starts-ends-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key starts-ends-flag not present in flag store. +______________ test_substring_operators[json-"uvwxyz"-"postfix"] _______________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...y=None, attributes={'id': 'uvwxyz'}), 'expected_value': 'postfix', 'key_and_default': ('starts-ends-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'postfix'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'postfix' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'starts-ends-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key starts-ends-flag not present in flag store. +_______________ test_substring_operators[json-"abcxyz"-"prefix"] _______________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...ey=None, attributes={'id': 'abcxyz'}), 'expected_value': 'prefix', 'key_and_default': ('starts-ends-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'prefix'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'prefix' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'starts-ends-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key starts-ends-flag not present in flag store. +________________ test_substring_operators[json-"lmnopq"-"none"] ________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta..._key=None, attributes={'id': 'lmnopq'}), 'expected_value': 'none', 'key_and_default': ('starts-ends-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'none'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'none' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'starts-ends-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key starts-ends-flag not present in flag store. +___________________ test_substring_operators[json-3-"none"] ____________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={'id': 3}), 'expected_value': 'none', 'key_and_default': ('starts-ends-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'none'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'none' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'starts-ends-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key starts-ends-flag not present in flag store. +___ test_semantic_version_operator_numeric_comparison[json-"2.0.0"-"equal"] ____ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...{'version': '2.0.0'}), 'expected_value': 'equal', 'key_and_default': ('equal-greater-lesser-version-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'equal'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'equal' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'equal-greater-lesser-version-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key equal-greater-lesser-version-flag not present in flag store. +__ test_semantic_version_operator_numeric_comparison[json-"2.1.0"-"greater"] ___ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...version': '2.1.0'}), 'expected_value': 'greater', 'key_and_default': ('equal-greater-lesser-version-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'greater'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'greater' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'equal-greater-lesser-version-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key equal-greater-lesser-version-flag not present in flag store. +___ test_semantic_version_operator_numeric_comparison[json-"1.9.0"-"lesser"] ___ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...'version': '1.9.0'}), 'expected_value': 'lesser', 'key_and_default': ('equal-greater-lesser-version-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'lesser'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'lesser' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'equal-greater-lesser-version-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key equal-greater-lesser-version-flag not present in flag store. +_ test_semantic_version_operator_numeric_comparison[json-"2.0.0-alpha"-"lesser"] _ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...on': '2.0.0-alpha'}), 'expected_value': 'lesser', 'key_and_default': ('equal-greater-lesser-version-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'lesser'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'lesser' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'equal-greater-lesser-version-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key equal-greater-lesser-version-flag not present in flag store. +___ test_semantic_version_operator_numeric_comparison[json-"2.0.0.0"-"none"] ___ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...'version': '2.0.0.0'}), 'expected_value': 'none', 'key_and_default': ('equal-greater-lesser-version-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'none'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'none' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'equal-greater-lesser-version-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key equal-greater-lesser-version-flag not present in flag store. +___ test_semantic_version_operator_semantic_comparison[json-"3.0.1"-"minor"] ___ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...tributes={'version': '3.0.1'}), 'expected_value': 'minor', 'key_and_default': ('major-minor-version-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'minor'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'minor' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'major-minor-version-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key major-minor-version-flag not present in flag store. +___ test_semantic_version_operator_semantic_comparison[json-"3.1.0"-"major"] ___ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...tributes={'version': '3.1.0'}), 'expected_value': 'major', 'key_and_default': ('major-minor-version-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'major'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'major' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'major-minor-version-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key major-minor-version-flag not present in flag store. +___ test_semantic_version_operator_semantic_comparison[json-"4.0.0"-"none"] ____ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...ttributes={'version': '4.0.0'}), 'expected_value': 'none', 'key_and_default': ('major-minor-version-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'none'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'none' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'major-minor-version-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key major-minor-version-flag not present in flag store. +_____________________ test_timebased_operations[json-1--1] _____________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={'time': 1}), 'expected_value': -1, 'key_and_default': ('timestamp-flag', 0)} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:219: in assert_integer_value + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = '0 != -1' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 0 != -1 + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'timestamp-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 124, in resolve_integer_details + return self.resolver.resolve_integer_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 73, in resolve_integer_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key timestamp-flag not present in flag store. +_________________ test_timebased_operations[json-4133980802-1] _________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={'time': 4133980802}), 'expected_value': 1, 'key_and_default': ('timestamp-flag', 0)} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:219: in assert_integer_value + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = '0 != 1' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 0 != 1 + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'timestamp-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 124, in resolve_integer_details + return self.resolver.resolve_integer_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 73, in resolve_integer_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key timestamp-flag not present in flag store. +_ test_targeting_by_targeting_key[json-"5c3d8535-f81a-4478-a6d3-afaa4d51199e"-"hit"-"TARGETING_MATCH"] _ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...478-a6d3-afaa4d51199e', attributes={}), 'expected_value': 'hit', 'key_and_default': ('targeting-key-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'hit'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'hit' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'targeting-key-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key targeting-key-flag not present in flag store. +_ test_targeting_by_targeting_key[json-"f20bd32d-703b-48b6-bc8e-79d53c85134a"-"miss"-"DEFAULT"] _ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...b6-bc8e-79d53c85134a', attributes={}), 'expected_value': 'miss', 'key_and_default': ('targeting-key-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'miss'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'miss' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'targeting-key-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key targeting-key-flag not present in flag store. +_______ test_errors_and_edge_cases[json-"targeting-null-variant-flag"-2] _______ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': 2, 'key_and_default': ('targeting-null-variant-flag', 3)} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:219: in assert_integer_value + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = '3 != 2' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 3 != 2 + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'targeting-null-variant-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 124, in resolve_integer_details + return self.resolver.resolve_integer_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 73, in resolve_integer_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key targeting-null-variant-flag not present in flag store. +____ test_errors_and_edge_cases[json-"non-string-variant-targeting-flag"-2] ____ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': 2, 'key_and_default': ('non-string-variant-targeting-flag', 3)} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:219: in assert_integer_value + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = '3 != 2' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 3 != 2 + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'non-string-variant-targeting-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 124, in resolve_integer_details + return self.resolver.resolve_integer_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 73, in resolve_integer_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key non-string-variant-targeting-flag not present in flag store. +__________ test_errors_and_edge_cases[json-"empty-targeting-flag"-1] ___________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': 1, 'key_and_default': ('empty-targeting-flag', 3)} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:219: in assert_integer_value + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = '3 != 1' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 3 != 1 + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'empty-targeting-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 124, in resolve_integer_details + return self.resolver.resolve_integer_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 73, in resolve_integer_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key empty-targeting-flag not present in flag store. +____________________ test_resolves_boolean_zero_value[json] ____________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': False, 'key_and_default': ('boolean-zero-flag', True)} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:180: in assert_boolean_value + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = 'True != False' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: True != False + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'boolean-zero-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 94, in resolve_boolean_details + return self.resolver.resolve_boolean_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 49, in resolve_boolean_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key boolean-zero-flag not present in flag store. +____________________ test_resolves_string_zero_value[json] _____________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'key_and_default': ('string-zero-flag', 'hi')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:301: in assert_empty_string + assert_string(client, key_and_default, evaluation_context, "") +tests/e2e/steps.py:317: in assert_string + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'hi' != ''" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'hi' != '' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'string-zero-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key string-zero-flag not present in flag store. +____________________ test_resolves_integer_zero_value[json] ____________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': 0, 'key_and_default': ('integer-zero-flag', 1)} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:219: in assert_integer_value + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = '1 != 0' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 1 != 0 + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'integer-zero-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 124, in resolve_integer_details + return self.resolver.resolve_integer_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 73, in resolve_integer_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key integer-zero-flag not present in flag store. +_____________________ test_resolves_float_zero_value[json] _____________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': 0.0, 'key_and_default': ('float-zero-flag', 0.1)} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:256: in assert_float_value + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = '0.1 != 0.0' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 0.1 != 0.0 + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'float-zero-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 114, in resolve_float_details + return self.resolver.resolve_float_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 65, in resolve_float_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key float-zero-flag not present in flag store. +______________________ test_resolves_boolean_value[yaml] _______________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': True, 'key_and_default': ('boolean-flag', False)} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:180: in assert_boolean_value + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = 'False != True' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: False != True + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'boolean-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 94, in resolve_boolean_details + return self.resolver.resolve_boolean_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 49, in resolve_boolean_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key boolean-flag not present in flag store. +_______________________ test_resolves_string_value[yaml] _______________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': 'hi', 'key_and_default': ('string-flag', 'bye')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:317: in assert_string + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'bye' != 'hi'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'bye' != 'hi' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'string-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key string-flag not present in flag store. +______________________ test_resolves_integer_value[yaml] _______________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': 10, 'key_and_default': ('integer-flag', 1)} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:219: in assert_integer_value + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = '1 != 10' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 1 != 10 + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'integer-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 124, in resolve_integer_details + return self.resolver.resolve_integer_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 73, in resolve_integer_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key integer-flag not present in flag store. +_______________________ test_resolves_float_value[yaml] ________________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': 0.5, 'key_and_default': ('float-flag', 0.1)} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:256: in assert_float_value + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = '0.1 != 0.5' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 0.1 != 0.5 + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'float-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 114, in resolve_float_details + return self.resolver.resolve_float_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 65, in resolve_float_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key float-flag not present in flag store. +_______________________ test_resolves_object_value[yaml] _______________________ + +fixturefunc = +request = > +kwargs = {'bool_field': 'showImages', 'bvalue': True, 'client': , 'details': None, ...} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:383: in assert_object + assert_in(bool_field, evaluation_result) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:643: in assert_in + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'showImages' not in {}" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'showImages' not in {} + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'object-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 134, in resolve_object_details + return self.resolver.resolve_object_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 81, in resolve_object_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key object-flag not present in flag store. +_____________________ test_resolves_boolean_details[yaml] ______________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': True, 'key_and_default': ('boolean-flag', False), ...} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:199: in assert_boolean_value_with_details + assert_equal(evaluation_result.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = 'False != True' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: False != True + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'boolean-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 94, in resolve_boolean_details + return self.resolver.resolve_boolean_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 49, in resolve_boolean_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key boolean-flag not present in flag store. +______________________ test_resolves_string_details[yaml] ______________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': 'hi', 'key_and_default': ('string-flag', 'bye'), ...} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:476: in assert_string_value_with_details + assert_equal(evaluation_result.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'bye' != 'hi'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'bye' != 'hi' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'string-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key string-flag not present in flag store. +_____________________ test_resolves_integer_details[yaml] ______________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': 10, 'key_and_default': ('integer-flag', 1), ...} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:237: in assert_integer_value_with_details + assert_equal(evaluation_result.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = '1 != 10' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 1 != 10 + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'integer-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 124, in resolve_integer_details + return self.resolver.resolve_integer_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 73, in resolve_integer_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key integer-flag not present in flag store. +______________________ test_resolves_float_details[yaml] _______________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': 0.5, 'key_and_default': ('float-flag', 0.1), ...} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:274: in assert_float_value_with_details + assert_equal(evaluation_result.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = '0.1 != 0.5' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 0.1 != 0.5 + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'float-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 114, in resolve_float_details + return self.resolver.resolve_float_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 65, in resolve_float_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key float-flag not present in flag store. +______________________ test_resolves_object_details[yaml] ______________________ + +fixturefunc = +request = > +kwargs = {'bool_field': 'showImages', 'bvalue': True, 'client': , 'details': 'details', ...} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:374: in assert_object + assert_in(bool_field, value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:643: in assert_in + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'showImages' not in {}" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'showImages' not in {} + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'object-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 134, in resolve_object_details + return self.resolver.resolve_object_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 81, in resolve_object_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key object-flag not present in flag store. +_____________________ test_resolves_based_on_context[yaml] _____________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...opełk', 'age': 29, 'customer': False}), 'expected_value': 'INTERNAL', 'key_and_default': ('context-aware', 'EXTERNAL')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:333: in assert_string_response + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'EXTERNAL' != 'INTERNAL'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'EXTERNAL' != 'INTERNAL' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'context-aware' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key context-aware not present in flag store. +____________________________ test_type_error[yaml] _____________________________ + +fixturefunc = +request = > +kwargs = {'client': , 'error': 'TYPE_MISMATCH', 'evaluation_deta...ode=, error_message='Flag with key wrong-flag not present in flag store.')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:456: in assert_for_error + assert_equal(evaluation_details.error_code, ErrorCode[error]) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = " != " + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: != + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'wrong-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 124, in resolve_integer_details + return self.resolver.resolve_integer_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 73, in resolve_integer_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key wrong-flag not present in flag store. +__________ test_evaluator_reuse[yaml-"some-email-targeted-flag"-"hi"] __________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...email': 'ballmer@macrosoft.com'}), 'expected_value': 'hi', 'key_and_default': ('some-email-targeted-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'hi'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'hi' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'some-email-targeted-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key some-email-targeted-flag not present in flag store. +______ test_evaluator_reuse[yaml-"some-other-email-targeted-flag"-"yes"] _______ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta... 'ballmer@macrosoft.com'}), 'expected_value': 'yes', 'key_and_default': ('some-other-email-targeted-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'yes'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'yes' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'some-other-email-targeted-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key some-other-email-targeted-flag not present in flag store. +________________ test_fractional_operator[yaml-"jack"-"spades"] ________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...attributes={'user': {'name': 'jack'}}), 'expected_value': 'spades', 'key_and_default': ('fractional-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'spades'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'spades' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag not present in flag store. +________________ test_fractional_operator[yaml-"queen"-"clubs"] ________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...attributes={'user': {'name': 'queen'}}), 'expected_value': 'clubs', 'key_and_default': ('fractional-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'clubs'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'clubs' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag not present in flag store. +_______________ test_fractional_operator[yaml-"ten"-"diamonds"] ________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...ttributes={'user': {'name': 'ten'}}), 'expected_value': 'diamonds', 'key_and_default': ('fractional-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'diamonds'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'diamonds' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag not present in flag store. +________________ test_fractional_operator[yaml-"nine"-"hearts"] ________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...attributes={'user': {'name': 'nine'}}), 'expected_value': 'hearts', 'key_and_default': ('fractional-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'hearts'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'hearts' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag not present in flag store. +_________________ test_fractional_operator[yaml-3-"diamonds"] __________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...e, attributes={'user': {'name': 3}}), 'expected_value': 'diamonds', 'key_and_default': ('fractional-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'diamonds'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'diamonds' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag not present in flag store. +_______ test_fractional_operator_with_shared_seed[yaml-"jack"-"hearts"] ________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...ser': {'name': 'jack'}}), 'expected_value': 'hearts', 'key_and_default': ('fractional-flag-A-shared-seed', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'hearts'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'hearts' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag-A-shared-seed' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag-A-shared-seed not present in flag store. +_______ test_fractional_operator_with_shared_seed[yaml-"queen"-"spades"] _______ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...er': {'name': 'queen'}}), 'expected_value': 'spades', 'key_and_default': ('fractional-flag-A-shared-seed', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'spades'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'spades' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag-A-shared-seed' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag-A-shared-seed not present in flag store. +________ test_fractional_operator_with_shared_seed[yaml-"ten"-"hearts"] ________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...user': {'name': 'ten'}}), 'expected_value': 'hearts', 'key_and_default': ('fractional-flag-A-shared-seed', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'hearts'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'hearts' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag-A-shared-seed' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag-A-shared-seed not present in flag store. +______ test_fractional_operator_with_shared_seed[yaml-"nine"-"diamonds"] _______ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...r': {'name': 'nine'}}), 'expected_value': 'diamonds', 'key_and_default': ('fractional-flag-A-shared-seed', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'diamonds'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'diamonds' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag-A-shared-seed' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag-A-shared-seed not present in flag store. +_ test_second_fractional_operator_with_shared_seed[yaml-"jack"-"ace-of-hearts"] _ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...'name': 'jack'}}), 'expected_value': 'ace-of-hearts', 'key_and_default': ('fractional-flag-B-shared-seed', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'ace-of-hearts'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'ace-of-hearts' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag-B-shared-seed' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag-B-shared-seed not present in flag store. +_ test_second_fractional_operator_with_shared_seed[yaml-"queen"-"ace-of-spades"] _ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...name': 'queen'}}), 'expected_value': 'ace-of-spades', 'key_and_default': ('fractional-flag-B-shared-seed', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'ace-of-spades'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'ace-of-spades' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag-B-shared-seed' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag-B-shared-seed not present in flag store. +_ test_second_fractional_operator_with_shared_seed[yaml-"ten"-"ace-of-hearts"] _ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...{'name': 'ten'}}), 'expected_value': 'ace-of-hearts', 'key_and_default': ('fractional-flag-B-shared-seed', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'ace-of-hearts'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'ace-of-hearts' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag-B-shared-seed' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag-B-shared-seed not present in flag store. +_ test_second_fractional_operator_with_shared_seed[yaml-"nine"-"ace-of-diamonds"] _ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...ame': 'nine'}}), 'expected_value': 'ace-of-diamonds', 'key_and_default': ('fractional-flag-B-shared-seed', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'ace-of-diamonds'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'ace-of-diamonds' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'fractional-flag-B-shared-seed' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key fractional-flag-B-shared-seed not present in flag store. +_______________ test_substring_operators[yaml-"abcdef"-"prefix"] _______________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...ey=None, attributes={'id': 'abcdef'}), 'expected_value': 'prefix', 'key_and_default': ('starts-ends-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'prefix'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'prefix' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'starts-ends-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key starts-ends-flag not present in flag store. +______________ test_substring_operators[yaml-"uvwxyz"-"postfix"] _______________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...y=None, attributes={'id': 'uvwxyz'}), 'expected_value': 'postfix', 'key_and_default': ('starts-ends-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'postfix'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'postfix' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'starts-ends-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key starts-ends-flag not present in flag store. +_______________ test_substring_operators[yaml-"abcxyz"-"prefix"] _______________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...ey=None, attributes={'id': 'abcxyz'}), 'expected_value': 'prefix', 'key_and_default': ('starts-ends-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'prefix'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'prefix' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'starts-ends-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key starts-ends-flag not present in flag store. +________________ test_substring_operators[yaml-"lmnopq"-"none"] ________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta..._key=None, attributes={'id': 'lmnopq'}), 'expected_value': 'none', 'key_and_default': ('starts-ends-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'none'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'none' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'starts-ends-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key starts-ends-flag not present in flag store. +___________________ test_substring_operators[yaml-3-"none"] ____________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={'id': 3}), 'expected_value': 'none', 'key_and_default': ('starts-ends-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'none'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'none' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'starts-ends-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key starts-ends-flag not present in flag store. +___ test_semantic_version_operator_numeric_comparison[yaml-"2.0.0"-"equal"] ____ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...{'version': '2.0.0'}), 'expected_value': 'equal', 'key_and_default': ('equal-greater-lesser-version-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'equal'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'equal' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'equal-greater-lesser-version-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key equal-greater-lesser-version-flag not present in flag store. +__ test_semantic_version_operator_numeric_comparison[yaml-"2.1.0"-"greater"] ___ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...version': '2.1.0'}), 'expected_value': 'greater', 'key_and_default': ('equal-greater-lesser-version-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'greater'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'greater' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'equal-greater-lesser-version-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key equal-greater-lesser-version-flag not present in flag store. +___ test_semantic_version_operator_numeric_comparison[yaml-"1.9.0"-"lesser"] ___ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...'version': '1.9.0'}), 'expected_value': 'lesser', 'key_and_default': ('equal-greater-lesser-version-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'lesser'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'lesser' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'equal-greater-lesser-version-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key equal-greater-lesser-version-flag not present in flag store. +_ test_semantic_version_operator_numeric_comparison[yaml-"2.0.0-alpha"-"lesser"] _ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...on': '2.0.0-alpha'}), 'expected_value': 'lesser', 'key_and_default': ('equal-greater-lesser-version-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'lesser'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'lesser' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'equal-greater-lesser-version-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key equal-greater-lesser-version-flag not present in flag store. +___ test_semantic_version_operator_numeric_comparison[yaml-"2.0.0.0"-"none"] ___ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...'version': '2.0.0.0'}), 'expected_value': 'none', 'key_and_default': ('equal-greater-lesser-version-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'none'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'none' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'equal-greater-lesser-version-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key equal-greater-lesser-version-flag not present in flag store. +___ test_semantic_version_operator_semantic_comparison[yaml-"3.0.1"-"minor"] ___ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...tributes={'version': '3.0.1'}), 'expected_value': 'minor', 'key_and_default': ('major-minor-version-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'minor'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'minor' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'major-minor-version-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key major-minor-version-flag not present in flag store. +___ test_semantic_version_operator_semantic_comparison[yaml-"3.1.0"-"major"] ___ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...tributes={'version': '3.1.0'}), 'expected_value': 'major', 'key_and_default': ('major-minor-version-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'major'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'major' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'major-minor-version-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key major-minor-version-flag not present in flag store. +___ test_semantic_version_operator_semantic_comparison[yaml-"4.0.0"-"none"] ____ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...ttributes={'version': '4.0.0'}), 'expected_value': 'none', 'key_and_default': ('major-minor-version-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'none'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'none' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'major-minor-version-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key major-minor-version-flag not present in flag store. +_____________________ test_timebased_operations[yaml-1--1] _____________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={'time': 1}), 'expected_value': -1, 'key_and_default': ('timestamp-flag', 0)} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:219: in assert_integer_value + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = '0 != -1' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 0 != -1 + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'timestamp-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 124, in resolve_integer_details + return self.resolver.resolve_integer_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 73, in resolve_integer_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key timestamp-flag not present in flag store. +_________________ test_timebased_operations[yaml-4133980802-1] _________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={'time': 4133980802}), 'expected_value': 1, 'key_and_default': ('timestamp-flag', 0)} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:219: in assert_integer_value + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = '0 != 1' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 0 != 1 + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'timestamp-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 124, in resolve_integer_details + return self.resolver.resolve_integer_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 73, in resolve_integer_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key timestamp-flag not present in flag store. +_ test_targeting_by_targeting_key[yaml-"5c3d8535-f81a-4478-a6d3-afaa4d51199e"-"hit"-"TARGETING_MATCH"] _ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...478-a6d3-afaa4d51199e', attributes={}), 'expected_value': 'hit', 'key_and_default': ('targeting-key-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'hit'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'hit' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'targeting-key-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key targeting-key-flag not present in flag store. +_ test_targeting_by_targeting_key[yaml-"f20bd32d-703b-48b6-bc8e-79d53c85134a"-"miss"-"DEFAULT"] _ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(ta...b6-bc8e-79d53c85134a', attributes={}), 'expected_value': 'miss', 'key_and_default': ('targeting-key-flag', 'fallback')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:288: in assert_string_value + assert_equal(evaluation_details.value, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'fallback' != 'miss'" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'fallback' != 'miss' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'targeting-key-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key targeting-key-flag not present in flag store. +_______ test_errors_and_edge_cases[yaml-"targeting-null-variant-flag"-2] _______ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': 2, 'key_and_default': ('targeting-null-variant-flag', 3)} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:219: in assert_integer_value + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = '3 != 2' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 3 != 2 + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'targeting-null-variant-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 124, in resolve_integer_details + return self.resolver.resolve_integer_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 73, in resolve_integer_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key targeting-null-variant-flag not present in flag store. +____ test_errors_and_edge_cases[yaml-"non-string-variant-targeting-flag"-2] ____ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': 2, 'key_and_default': ('non-string-variant-targeting-flag', 3)} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:219: in assert_integer_value + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = '3 != 2' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 3 != 2 + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'non-string-variant-targeting-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 124, in resolve_integer_details + return self.resolver.resolve_integer_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 73, in resolve_integer_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key non-string-variant-targeting-flag not present in flag store. +__________ test_errors_and_edge_cases[yaml-"empty-targeting-flag"-1] ___________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': 1, 'key_and_default': ('empty-targeting-flag', 3)} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:219: in assert_integer_value + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = '3 != 1' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 3 != 1 + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'empty-targeting-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 124, in resolve_integer_details + return self.resolver.resolve_integer_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 73, in resolve_integer_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key empty-targeting-flag not present in flag store. +____________________ test_resolves_boolean_zero_value[yaml] ____________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': False, 'key_and_default': ('boolean-zero-flag', True)} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:180: in assert_boolean_value + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = 'True != False' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: True != False + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'boolean-zero-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 94, in resolve_boolean_details + return self.resolver.resolve_boolean_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 49, in resolve_boolean_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key boolean-zero-flag not present in flag store. +____________________ test_resolves_string_zero_value[yaml] _____________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'key_and_default': ('string-zero-flag', 'hi')} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:301: in assert_empty_string + assert_string(client, key_and_default, evaluation_context, "") +tests/e2e/steps.py:317: in assert_string + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = "'hi' != ''" + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 'hi' != '' + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'string-zero-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 104, in resolve_string_details + return self.resolver.resolve_string_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 57, in resolve_string_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key string-zero-flag not present in flag store. +____________________ test_resolves_integer_zero_value[yaml] ____________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': 0, 'key_and_default': ('integer-zero-flag', 1)} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:219: in assert_integer_value + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = '1 != 0' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 1 != 0 + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'integer-zero-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 124, in resolve_integer_details + return self.resolver.resolve_integer_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 73, in resolve_integer_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key integer-zero-flag not present in flag store. +_____________________ test_resolves_float_zero_value[yaml] _____________________ + +fixturefunc = +request = > +kwargs = {'client': , 'evaluation_context': EvaluationContext(targeting_key=None, attributes={}), 'expected_value': 0.0, 'key_and_default': ('float-zero-flag', 0.1)} + + def call_fixture_func( + fixturefunc: "_FixtureFunc[FixtureValue]", request: FixtureRequest, kwargs + ) -> FixtureValue: + if is_generator(fixturefunc): + fixturefunc = cast( + Callable[..., Generator[FixtureValue, None, None]], fixturefunc + ) + generator = fixturefunc(**kwargs) + try: + fixture_result = next(generator) + except StopIteration: + raise ValueError(f"{request.fixturename} did not yield a value") from None + finalizer = functools.partial(_teardown_yield_fixture, fixturefunc, generator) + request.addfinalizer(finalizer) + else: + fixturefunc = cast(Callable[..., FixtureValue], fixturefunc) +> fixture_result = fixturefunc(**kwargs) + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/_pytest/fixtures.py:887: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +tests/e2e/steps.py:256: in assert_float_value + assert_equal(evaluation_result, expected_value) +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:179: in assert_equal + fail(msg_fmt.format(msg=msg, first=first, second=second)) +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +msg = '0.1 != 0.0' + + def fail(msg=None): + """Raise an AssertionError with the given message. + + >>> fail("my message") + Traceback (most recent call last): + ... + AssertionError: my message + + """ +> raise AssertionError(msg or "assertion failure") +E AssertionError: 0.1 != 0.0 + +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/asserts/__init__.py:44: AssertionError +------------------------------ Captured log call ------------------------------- +ERROR openfeature:client.py:364 Error ErrorCode.FLAG_NOT_FOUND while evaluating flag with key: 'float-zero-flag' +Traceback (most recent call last): + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 345, in evaluate_flag_details + flag_evaluation = self._create_provider_evaluation( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/client.py", line 436, in _create_provider_evaluation + resolution = get_details_callable(*args) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py", line 114, in resolve_float_details + return self.resolver.resolve_float_details( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 65, in resolve_float_details + return self._resolve(key, default_value, evaluation_context) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/in_process.py", line 91, in _resolve + raise FlagNotFoundError(f"Flag with key {key} not present in flag store.") +openfeature.exception.FlagNotFoundError: Flag with key float-zero-flag not present in flag store. +=============================== warnings summary =============================== +../../../../../.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/provider/provider.py:7 + /home/simonschrottner/.local/share/hatch/env/virtual/openfeature-provider-flagd/UIGBFyUg/openfeature-provider-flagd/lib/python3.12/site-packages/openfeature/provider/provider.py:7: DeprecationWarning: openfeature.provider.provider is deprecated, use openfeature.provider instead + warnings.warn( + +tests/e2e/test_in-process-file.py:44 + /home/simonschrottner/projects/openFeature/python-sdk-contrib/providers/openfeature-provider-flagd/tests/e2e/test_in-process-file.py:44: SyntaxWarning: "is" with 'str' literal. Did you mean "=="? + if type is "json" : json.dump(result, outfile) + +-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html +=========================== short test summary info ============================ +FAILED tests/e2e/test_in-process-file.py::test_resolves_boolean_value[json] +FAILED tests/e2e/test_in-process-file.py::test_resolves_string_value[json] - ... +FAILED tests/e2e/test_in-process-file.py::test_resolves_integer_value[json] +FAILED tests/e2e/test_in-process-file.py::test_resolves_float_value[json] - A... +FAILED tests/e2e/test_in-process-file.py::test_resolves_object_value[json] - ... +FAILED tests/e2e/test_in-process-file.py::test_resolves_boolean_details[json] +FAILED tests/e2e/test_in-process-file.py::test_resolves_string_details[json] +FAILED tests/e2e/test_in-process-file.py::test_resolves_integer_details[json] +FAILED tests/e2e/test_in-process-file.py::test_resolves_float_details[json] +FAILED tests/e2e/test_in-process-file.py::test_resolves_object_details[json] +FAILED tests/e2e/test_in-process-file.py::test_resolves_based_on_context[json] +FAILED tests/e2e/test_in-process-file.py::test_type_error[json] - AssertionEr... +FAILED tests/e2e/test_in-process-file.py::test_evaluator_reuse[json-"some-email-targeted-flag"-"hi"] +FAILED tests/e2e/test_in-process-file.py::test_evaluator_reuse[json-"some-other-email-targeted-flag"-"yes"] +FAILED tests/e2e/test_in-process-file.py::test_fractional_operator[json-"jack"-"spades"] +FAILED tests/e2e/test_in-process-file.py::test_fractional_operator[json-"queen"-"clubs"] +FAILED tests/e2e/test_in-process-file.py::test_fractional_operator[json-"ten"-"diamonds"] +FAILED tests/e2e/test_in-process-file.py::test_fractional_operator[json-"nine"-"hearts"] +FAILED tests/e2e/test_in-process-file.py::test_fractional_operator[json-3-"diamonds"] +FAILED tests/e2e/test_in-process-file.py::test_fractional_operator_with_shared_seed[json-"jack"-"hearts"] +FAILED tests/e2e/test_in-process-file.py::test_fractional_operator_with_shared_seed[json-"queen"-"spades"] +FAILED tests/e2e/test_in-process-file.py::test_fractional_operator_with_shared_seed[json-"ten"-"hearts"] +FAILED tests/e2e/test_in-process-file.py::test_fractional_operator_with_shared_seed[json-"nine"-"diamonds"] +FAILED tests/e2e/test_in-process-file.py::test_second_fractional_operator_with_shared_seed[json-"jack"-"ace-of-hearts"] +FAILED tests/e2e/test_in-process-file.py::test_second_fractional_operator_with_shared_seed[json-"queen"-"ace-of-spades"] +FAILED tests/e2e/test_in-process-file.py::test_second_fractional_operator_with_shared_seed[json-"ten"-"ace-of-hearts"] +FAILED tests/e2e/test_in-process-file.py::test_second_fractional_operator_with_shared_seed[json-"nine"-"ace-of-diamonds"] +FAILED tests/e2e/test_in-process-file.py::test_substring_operators[json-"abcdef"-"prefix"] +FAILED tests/e2e/test_in-process-file.py::test_substring_operators[json-"uvwxyz"-"postfix"] +FAILED tests/e2e/test_in-process-file.py::test_substring_operators[json-"abcxyz"-"prefix"] +FAILED tests/e2e/test_in-process-file.py::test_substring_operators[json-"lmnopq"-"none"] +FAILED tests/e2e/test_in-process-file.py::test_substring_operators[json-3-"none"] +FAILED tests/e2e/test_in-process-file.py::test_semantic_version_operator_numeric_comparison[json-"2.0.0"-"equal"] +FAILED tests/e2e/test_in-process-file.py::test_semantic_version_operator_numeric_comparison[json-"2.1.0"-"greater"] +FAILED tests/e2e/test_in-process-file.py::test_semantic_version_operator_numeric_comparison[json-"1.9.0"-"lesser"] +FAILED tests/e2e/test_in-process-file.py::test_semantic_version_operator_numeric_comparison[json-"2.0.0-alpha"-"lesser"] +FAILED tests/e2e/test_in-process-file.py::test_semantic_version_operator_numeric_comparison[json-"2.0.0.0"-"none"] +FAILED tests/e2e/test_in-process-file.py::test_semantic_version_operator_semantic_comparison[json-"3.0.1"-"minor"] +FAILED tests/e2e/test_in-process-file.py::test_semantic_version_operator_semantic_comparison[json-"3.1.0"-"major"] +FAILED tests/e2e/test_in-process-file.py::test_semantic_version_operator_semantic_comparison[json-"4.0.0"-"none"] +FAILED tests/e2e/test_in-process-file.py::test_timebased_operations[json-1--1] +FAILED tests/e2e/test_in-process-file.py::test_timebased_operations[json-4133980802-1] +FAILED tests/e2e/test_in-process-file.py::test_targeting_by_targeting_key[json-"5c3d8535-f81a-4478-a6d3-afaa4d51199e"-"hit"-"TARGETING_MATCH"] +FAILED tests/e2e/test_in-process-file.py::test_targeting_by_targeting_key[json-"f20bd32d-703b-48b6-bc8e-79d53c85134a"-"miss"-"DEFAULT"] +FAILED tests/e2e/test_in-process-file.py::test_errors_and_edge_cases[json-"targeting-null-variant-flag"-2] +FAILED tests/e2e/test_in-process-file.py::test_errors_and_edge_cases[json-"non-string-variant-targeting-flag"-2] +FAILED tests/e2e/test_in-process-file.py::test_errors_and_edge_cases[json-"empty-targeting-flag"-1] +FAILED tests/e2e/test_in-process-file.py::test_resolves_boolean_zero_value[json] +FAILED tests/e2e/test_in-process-file.py::test_resolves_string_zero_value[json] +FAILED tests/e2e/test_in-process-file.py::test_resolves_integer_zero_value[json] +FAILED tests/e2e/test_in-process-file.py::test_resolves_float_zero_value[json] +FAILED tests/e2e/test_in-process-file.py::test_resolves_boolean_value[yaml] +FAILED tests/e2e/test_in-process-file.py::test_resolves_string_value[yaml] - ... +FAILED tests/e2e/test_in-process-file.py::test_resolves_integer_value[yaml] +FAILED tests/e2e/test_in-process-file.py::test_resolves_float_value[yaml] - A... +FAILED tests/e2e/test_in-process-file.py::test_resolves_object_value[yaml] - ... +FAILED tests/e2e/test_in-process-file.py::test_resolves_boolean_details[yaml] +FAILED tests/e2e/test_in-process-file.py::test_resolves_string_details[yaml] +FAILED tests/e2e/test_in-process-file.py::test_resolves_integer_details[yaml] +FAILED tests/e2e/test_in-process-file.py::test_resolves_float_details[yaml] +FAILED tests/e2e/test_in-process-file.py::test_resolves_object_details[yaml] +FAILED tests/e2e/test_in-process-file.py::test_resolves_based_on_context[yaml] +FAILED tests/e2e/test_in-process-file.py::test_type_error[yaml] - AssertionEr... +FAILED tests/e2e/test_in-process-file.py::test_evaluator_reuse[yaml-"some-email-targeted-flag"-"hi"] +FAILED tests/e2e/test_in-process-file.py::test_evaluator_reuse[yaml-"some-other-email-targeted-flag"-"yes"] +FAILED tests/e2e/test_in-process-file.py::test_fractional_operator[yaml-"jack"-"spades"] +FAILED tests/e2e/test_in-process-file.py::test_fractional_operator[yaml-"queen"-"clubs"] +FAILED tests/e2e/test_in-process-file.py::test_fractional_operator[yaml-"ten"-"diamonds"] +FAILED tests/e2e/test_in-process-file.py::test_fractional_operator[yaml-"nine"-"hearts"] +FAILED tests/e2e/test_in-process-file.py::test_fractional_operator[yaml-3-"diamonds"] +FAILED tests/e2e/test_in-process-file.py::test_fractional_operator_with_shared_seed[yaml-"jack"-"hearts"] +FAILED tests/e2e/test_in-process-file.py::test_fractional_operator_with_shared_seed[yaml-"queen"-"spades"] +FAILED tests/e2e/test_in-process-file.py::test_fractional_operator_with_shared_seed[yaml-"ten"-"hearts"] +FAILED tests/e2e/test_in-process-file.py::test_fractional_operator_with_shared_seed[yaml-"nine"-"diamonds"] +FAILED tests/e2e/test_in-process-file.py::test_second_fractional_operator_with_shared_seed[yaml-"jack"-"ace-of-hearts"] +FAILED tests/e2e/test_in-process-file.py::test_second_fractional_operator_with_shared_seed[yaml-"queen"-"ace-of-spades"] +FAILED tests/e2e/test_in-process-file.py::test_second_fractional_operator_with_shared_seed[yaml-"ten"-"ace-of-hearts"] +FAILED tests/e2e/test_in-process-file.py::test_second_fractional_operator_with_shared_seed[yaml-"nine"-"ace-of-diamonds"] +FAILED tests/e2e/test_in-process-file.py::test_substring_operators[yaml-"abcdef"-"prefix"] +FAILED tests/e2e/test_in-process-file.py::test_substring_operators[yaml-"uvwxyz"-"postfix"] +FAILED tests/e2e/test_in-process-file.py::test_substring_operators[yaml-"abcxyz"-"prefix"] +FAILED tests/e2e/test_in-process-file.py::test_substring_operators[yaml-"lmnopq"-"none"] +FAILED tests/e2e/test_in-process-file.py::test_substring_operators[yaml-3-"none"] +FAILED tests/e2e/test_in-process-file.py::test_semantic_version_operator_numeric_comparison[yaml-"2.0.0"-"equal"] +FAILED tests/e2e/test_in-process-file.py::test_semantic_version_operator_numeric_comparison[yaml-"2.1.0"-"greater"] +FAILED tests/e2e/test_in-process-file.py::test_semantic_version_operator_numeric_comparison[yaml-"1.9.0"-"lesser"] +FAILED tests/e2e/test_in-process-file.py::test_semantic_version_operator_numeric_comparison[yaml-"2.0.0-alpha"-"lesser"] +FAILED tests/e2e/test_in-process-file.py::test_semantic_version_operator_numeric_comparison[yaml-"2.0.0.0"-"none"] +FAILED tests/e2e/test_in-process-file.py::test_semantic_version_operator_semantic_comparison[yaml-"3.0.1"-"minor"] +FAILED tests/e2e/test_in-process-file.py::test_semantic_version_operator_semantic_comparison[yaml-"3.1.0"-"major"] +FAILED tests/e2e/test_in-process-file.py::test_semantic_version_operator_semantic_comparison[yaml-"4.0.0"-"none"] +FAILED tests/e2e/test_in-process-file.py::test_timebased_operations[yaml-1--1] +FAILED tests/e2e/test_in-process-file.py::test_timebased_operations[yaml-4133980802-1] +FAILED tests/e2e/test_in-process-file.py::test_targeting_by_targeting_key[yaml-"5c3d8535-f81a-4478-a6d3-afaa4d51199e"-"hit"-"TARGETING_MATCH"] +FAILED tests/e2e/test_in-process-file.py::test_targeting_by_targeting_key[yaml-"f20bd32d-703b-48b6-bc8e-79d53c85134a"-"miss"-"DEFAULT"] +FAILED tests/e2e/test_in-process-file.py::test_errors_and_edge_cases[yaml-"targeting-null-variant-flag"-2] +FAILED tests/e2e/test_in-process-file.py::test_errors_and_edge_cases[yaml-"non-string-variant-targeting-flag"-2] +FAILED tests/e2e/test_in-process-file.py::test_errors_and_edge_cases[yaml-"empty-targeting-flag"-1] +FAILED tests/e2e/test_in-process-file.py::test_resolves_boolean_zero_value[yaml] +FAILED tests/e2e/test_in-process-file.py::test_resolves_string_zero_value[yaml] +FAILED tests/e2e/test_in-process-file.py::test_resolves_integer_zero_value[yaml] +FAILED tests/e2e/test_in-process-file.py::test_resolves_float_zero_value[yaml] +================== 102 failed, 75 passed, 2 warnings in 9.27s ================== diff --git a/providers/openfeature-provider-flagd/tests/conftest.py b/providers/openfeature-provider-flagd/tests/conftest.py index 287f5240..692b84b2 100644 --- a/providers/openfeature-provider-flagd/tests/conftest.py +++ b/providers/openfeature-provider-flagd/tests/conftest.py @@ -1,4 +1,5 @@ import os +from pathlib import Path import pytest @@ -8,13 +9,14 @@ @pytest.fixture() def flagd_provider_client(): - api.set_provider(FlagdProvider()) - return api.get_client() + provider = FlagdProvider() + api.set_provider(provider) + yield api.get_client() + provider.shutdown() def setup_flag_file(base_dir: str, flag_file: str) -> str: - with open(f"test-harness/flags/{flag_file}") as src_file: - contents = src_file.read() + contents = (Path(__file__).parent / "../test-harness/flags" / flag_file).read_text() dst_path = os.path.join(base_dir, flag_file) with open(dst_path, "w") as dst_file: dst_file.write(contents) diff --git a/providers/openfeature-provider-flagd/tests/e2e/conftest.py b/providers/openfeature-provider-flagd/tests/e2e/conftest.py index 077e6926..7c8accd1 100644 --- a/providers/openfeature-provider-flagd/tests/e2e/conftest.py +++ b/providers/openfeature-provider-flagd/tests/e2e/conftest.py @@ -1,8 +1,5 @@ import typing -import pytest -from testcontainers.core.container import DockerContainer -from tests.e2e.flagd_container import FlagdContainer from tests.e2e.steps import * # noqa: F403 JsonPrimitive = typing.Union[str, bool, float, int] @@ -13,26 +10,8 @@ # running all gherkin tests, except the ones, not implemented def pytest_collection_modifyitems(config): - marker = "not customCert and not unixsocket and not sync and not targetURI" + marker = "not customCert and not unixsocket and not targetURI" # this seems to not work with python 3.8 if hasattr(config.option, "markexpr") and config.option.markexpr == "": config.option.markexpr = marker - - -@pytest.fixture(autouse=True, scope="module") -def setup(request, port, image): - container: DockerContainer = FlagdContainer( - image=image, - port=port, - ) - # Setup code - c = container.start() - - def fin(): - c.stop() - - # Teardown code - request.addfinalizer(fin) - - return c.get_exposed_port(port) diff --git a/providers/openfeature-provider-flagd/tests/e2e/flagd_container.py b/providers/openfeature-provider-flagd/tests/e2e/flagd_container.py index e80fb0f7..31045759 100644 --- a/providers/openfeature-provider-flagd/tests/e2e/flagd_container.py +++ b/providers/openfeature-provider-flagd/tests/e2e/flagd_container.py @@ -1,4 +1,5 @@ import time +from pathlib import Path import grpc from grpc_health.v1 import health_pb2, health_pb2_grpc @@ -11,11 +12,13 @@ class FlagdContainer(DockerContainer): def __init__( self, - image: str = "ghcr.io/open-feature/flagd-testbed:v0.5.15", + image: str = "ghcr.io/open-feature/flagd-testbed", port: int = 8013, **kwargs, ) -> None: - super().__init__(image, **kwargs) + path = Path(__file__).parents[2] / "openfeature/test-harness/version.txt" + data = path.read_text().rstrip() + super().__init__(f"{image}:v{data}", **kwargs) self.port = port self.with_exposed_ports(self.port, HEALTH_CHECK) diff --git a/providers/openfeature-provider-flagd/tests/e2e/steps.py b/providers/openfeature-provider-flagd/tests/e2e/steps.py index c81c8871..b1325aff 100644 --- a/providers/openfeature-provider-flagd/tests/e2e/steps.py +++ b/providers/openfeature-provider-flagd/tests/e2e/steps.py @@ -1,10 +1,13 @@ import logging +import threading import time import typing import pytest from asserts import assert_equal, assert_in, assert_not_equal, assert_true from pytest_bdd import given, parsers, then, when +from testcontainers.core.container import DockerContainer +from tests.e2e.flagd_container import FlagdContainer from tests.e2e.parsers import to_bool, to_list from openfeature import api @@ -26,9 +29,21 @@ def evaluation_context() -> EvaluationContext: @given("a flagd provider is set", target_fixture="client") @given("a provider is registered", target_fixture="client") -def setup_provider(setup, resolver_type, client_name) -> OpenFeatureClient: +def setup_provider( + container: FlagdContainer, resolver_type, client_name, port +) -> OpenFeatureClient: + try: + container.get_exposed_port(port) + except: # noqa: E722 + container.start() + api.set_provider( - FlagdProvider(resolver_type=resolver_type, port=setup, timeout=1), + FlagdProvider( + resolver_type=resolver_type, + port=int(container.get_exposed_port(port)), + timeout=1, + retry_grace_period=3, + ), client_name, ) client = api.get_client(client_name) @@ -517,6 +532,12 @@ def error_handles() -> list: return [] +@given( + parsers.cfparse( + "a {event_type:ProviderEvent} handler is added", + extra_types={"ProviderEvent": ProviderEvent}, + ), +) @when( parsers.cfparse( "a {event_type:ProviderEvent} handler is added", @@ -631,7 +652,10 @@ def assert_disconnect_error( def assert_flag_changed(event_handles, key): handle = None for h in event_handles: - if h["type"] == ProviderEvent.PROVIDER_CONFIGURATION_CHANGED: + if ( + h["type"] == ProviderEvent.PROVIDER_CONFIGURATION_CHANGED + and key in h["event"].flags_changed + ): handle = h break @@ -650,10 +674,7 @@ def wait_for(pred, poll_sec=2, timeout_sec=10): @given("flagd is unavailable", target_fixture="client") def flagd_unavailable(resolver_type): api.set_provider( - FlagdProvider( - resolver_type=resolver_type, - port=99999, - ), + FlagdProvider(resolver_type=resolver_type, port=99999, retry_grace_period=2), "unavailable", ) return api.get_client("unavailable") @@ -668,3 +689,33 @@ def flagd_init(client: OpenFeatureClient, event_handles, error_handles): @then("an error should be indicated within the configured deadline") def flagd_error(error_handles): assert_handlers(error_handles, ProviderEvent.PROVIDER_ERROR) + + +@when(parsers.cfparse("the connection is lost for {seconds}s")) +def flagd_restart(seconds, container): + def starting(): + container.start() + + container.stop() + threading.Timer(int(seconds), starting).start() + + +@pytest.fixture(autouse=True, scope="module") +def container(request, port, image): + container: DockerContainer = FlagdContainer( + image=image, + port=port, + ) + # Setup code + container = container.start() + + def fin(): + try: + container.stop() + except: # noqa: E722 + logging.debug("container was not running anymore") + + # Teardown code + request.addfinalizer(fin) + + return container diff --git a/providers/openfeature-provider-flagd/tests/e2e/test_config.py b/providers/openfeature-provider-flagd/tests/e2e/test_config.py index dc413aee..238112d2 100644 --- a/providers/openfeature-provider-flagd/tests/e2e/test_config.py +++ b/providers/openfeature-provider-flagd/tests/e2e/test_config.py @@ -37,8 +37,13 @@ def convert_resolver_type(val: typing.Union[str, ResolverType]) -> ResolverType: } -@pytest.fixture(autouse=True, scope="module") -def setup(request): +@pytest.fixture(autouse=True) +def container(): + pass + + +@pytest.fixture(autouse=True) +def setup_provider(request): pass diff --git a/providers/openfeature-provider-flagd/tests/e2e/test_in_process_file.py b/providers/openfeature-provider-flagd/tests/e2e/test_in_process_file.py index f73dc990..278bd1ea 100644 --- a/providers/openfeature-provider-flagd/tests/e2e/test_in_process_file.py +++ b/providers/openfeature-provider-flagd/tests/e2e/test_in_process_file.py @@ -62,6 +62,11 @@ def resolver_type() -> ResolverType: return ResolverType.IN_PROCESS +@pytest.fixture(autouse=True) +def container(): + pass + + @pytest.fixture(autouse=True, scope="module") def setup(request, client_name, file_name, resolver_type): """nothing to boot""" diff --git a/providers/openfeature-provider-flagd/tests/e2e/test_inprocess.py b/providers/openfeature-provider-flagd/tests/e2e/test_inprocess.py new file mode 100644 index 00000000..de4faedc --- /dev/null +++ b/providers/openfeature-provider-flagd/tests/e2e/test_inprocess.py @@ -0,0 +1,32 @@ +import pytest +from pytest_bdd import scenarios +from tests.e2e.conftest import SPEC_PATH, TEST_HARNESS_PATH + +from openfeature.contrib.provider.flagd.config import ResolverType + + +@pytest.fixture(autouse=True, scope="module") +def client_name() -> str: + return "in-process" + + +@pytest.fixture(autouse=True, scope="module") +def resolver_type() -> ResolverType: + return ResolverType.IN_PROCESS + + +@pytest.fixture(autouse=True, scope="module") +def port(): + return 8015 + + +@pytest.fixture(autouse=True, scope="module") +def image(): + return "ghcr.io/open-feature/flagd-testbed" + + +scenarios( + f"{TEST_HARNESS_PATH}/gherkin/flagd.feature", + f"{TEST_HARNESS_PATH}/gherkin/flagd-json-evaluator.feature", + f"{SPEC_PATH}/specification/assets/gherkin/evaluation.feature", +) diff --git a/providers/openfeature-provider-flagd/tests/e2e/test_inprocess_file.py b/providers/openfeature-provider-flagd/tests/e2e/test_inprocess_file.py new file mode 100644 index 00000000..a4e9d2a3 --- /dev/null +++ b/providers/openfeature-provider-flagd/tests/e2e/test_inprocess_file.py @@ -0,0 +1,118 @@ +import json +import os +import tempfile +from os import listdir + +import pytest +import yaml +from pytest_bdd import given, parsers, scenarios, when +from tests.e2e.conftest import SPEC_PATH, TEST_HARNESS_PATH +from tests.e2e.steps import wait_for + +from openfeature import api +from openfeature.client import OpenFeatureClient +from openfeature.contrib.provider.flagd import FlagdProvider +from openfeature.contrib.provider.flagd.config import ResolverType +from openfeature.provider import ProviderStatus + +KEY_EVALUATORS = "$evaluators" + +KEY_FLAGS = "flags" + +MERGED_FILE = "merged_file" + + +@pytest.fixture(scope="module") +def all_flags(request): + result = {KEY_FLAGS: {}, KEY_EVALUATORS: {}} + + path = os.path.abspath( + os.path.join(os.path.dirname(__file__), f"{TEST_HARNESS_PATH}/flags/") + ) + + for f in listdir(path): + with open(path + "/" + f, "rb") as infile: + loaded_json = json.load(infile) + result[KEY_FLAGS] = {**result[KEY_FLAGS], **loaded_json[KEY_FLAGS]} + if loaded_json.get(KEY_EVALUATORS): + result[KEY_EVALUATORS] = { + **result[KEY_EVALUATORS], + **loaded_json[KEY_EVALUATORS], + } + + return result + + +@pytest.fixture(params=["json", "yaml"], scope="module") +def file_name(request, all_flags): + extension = request.param + outfile = tempfile.NamedTemporaryFile("w", delete=False, suffix="." + extension) + write_test_file(outfile, all_flags) + return outfile + + +def write_test_file(outfile, all_flags): + with open(outfile.name, "w") as file: + if file.name.endswith("json"): + json.dump(all_flags, file) + else: + yaml.dump(all_flags, file) + + +@when( + parsers.cfparse('a flag with key "{flag_key}" is modified'), + target_fixture="changed_flag", +) +def changed_flag( + flag_key: str, + all_flags: dict, + file_name, +): + flag = all_flags[KEY_FLAGS][flag_key] + + other_variant = [k for k in flag["variants"] if flag["defaultVariant"] in k].pop() + + flag["defaultVariant"] = other_variant + + all_flags[KEY_FLAGS][flag_key] = flag + write_test_file(file_name, all_flags) + return flag_key + + +@pytest.fixture(autouse=True, scope="module") +def resolver_type() -> ResolverType: + return ResolverType.IN_PROCESS + + +@pytest.fixture(autouse=True, scope="module") +def client_name() -> str: + return "in-process-file" + + +@pytest.fixture(autouse=True, scope="module") +def setup(request, client_name, file_name, resolver_type): + """nothing to boot""" + api.set_provider( + FlagdProvider( + resolver_type=resolver_type, + offline_flag_source_path=file_name.name, + deadline=500, + retry_backoff_ms=100, + ), + client_name, + ) + + +@given("a flagd provider is set", target_fixture="client") +@given("a provider is registered", target_fixture="client") +def setup_provider(client_name) -> OpenFeatureClient: + client = api.get_client(client_name) + wait_for(lambda: client.get_provider_status() == ProviderStatus.READY) + return client + + +scenarios( + f"{TEST_HARNESS_PATH}/gherkin/flagd.feature", + f"{TEST_HARNESS_PATH}/gherkin/flagd-json-evaluator.feature", + f"{SPEC_PATH}/specification/assets/gherkin/evaluation.feature", +) diff --git a/providers/openfeature-provider-flagd/tests/e2e/test_inprocess_reconnect.py b/providers/openfeature-provider-flagd/tests/e2e/test_inprocess_reconnect.py new file mode 100644 index 00000000..f427effe --- /dev/null +++ b/providers/openfeature-provider-flagd/tests/e2e/test_inprocess_reconnect.py @@ -0,0 +1,31 @@ +import pytest +from pytest_bdd import scenarios +from tests.e2e.conftest import TEST_HARNESS_PATH + +from openfeature.contrib.provider.flagd.config import ResolverType + + +@pytest.fixture(autouse=True, scope="module") +def client_name() -> str: + return "in-process-reconnect" + + +@pytest.fixture(autouse=True, scope="module") +def resolver_type() -> ResolverType: + return ResolverType.IN_PROCESS + + +@pytest.fixture(autouse=True, scope="module") +def port(): + return 8015 + + +@pytest.fixture(autouse=True, scope="module") +def image(): + return "ghcr.io/open-feature/flagd-testbed-unstable" + + +scenarios( + f"{TEST_HARNESS_PATH}/gherkin/flagd-reconnect.feature", + f"{TEST_HARNESS_PATH}/gherkin/events.feature", +) diff --git a/providers/openfeature-provider-flagd/tests/e2e/test_rpc.py b/providers/openfeature-provider-flagd/tests/e2e/test_rpc.py index 3fefb300..e3508cf1 100644 --- a/providers/openfeature-provider-flagd/tests/e2e/test_rpc.py +++ b/providers/openfeature-provider-flagd/tests/e2e/test_rpc.py @@ -22,7 +22,7 @@ def port(): @pytest.fixture(autouse=True, scope="module") def image(): - return "ghcr.io/open-feature/flagd-testbed:v0.5.13" + return "ghcr.io/open-feature/flagd-testbed" scenarios( diff --git a/providers/openfeature-provider-flagd/tests/e2e/test_rpc_reconnect.py b/providers/openfeature-provider-flagd/tests/e2e/test_rpc_reconnect.py index f56e82b7..36f526e2 100644 --- a/providers/openfeature-provider-flagd/tests/e2e/test_rpc_reconnect.py +++ b/providers/openfeature-provider-flagd/tests/e2e/test_rpc_reconnect.py @@ -22,7 +22,7 @@ def port(): @pytest.fixture(autouse=True, scope="module") def image(): - return "ghcr.io/open-feature/flagd-testbed-unstable:v0.5.13" + return "ghcr.io/open-feature/flagd-testbed-unstable" scenarios( diff --git a/providers/openfeature-provider-flagd/tests/e2e/test_rpc_ssl.py b/providers/openfeature-provider-flagd/tests/e2e/test_rpc_ssl.py new file mode 100644 index 00000000..3a3214b3 --- /dev/null +++ b/providers/openfeature-provider-flagd/tests/e2e/test_rpc_ssl.py @@ -0,0 +1,68 @@ +from pathlib import Path + +import pytest +from pytest_bdd import given, scenarios +from tests.e2e.conftest import SPEC_PATH +from tests.e2e.flagd_container import FlagdContainer +from tests.e2e.steps import wait_for + +from openfeature import api +from openfeature.client import OpenFeatureClient +from openfeature.contrib.provider.flagd import FlagdProvider +from openfeature.contrib.provider.flagd.config import ResolverType +from openfeature.provider import ProviderStatus + + +@pytest.fixture(autouse=True, scope="module") +def client_name() -> str: + return "rpc" + + +@pytest.fixture(autouse=True, scope="module") +def resolver_type() -> ResolverType: + return ResolverType.RPC + + +@pytest.fixture(autouse=True, scope="module") +def port(): + return 8013 + + +@pytest.fixture(autouse=True, scope="module") +def image(): + return "ghcr.io/open-feature/flagd-testbed-ssl" + + +@given("a flagd provider is set", target_fixture="client") +@given("a provider is registered", target_fixture="client") +def setup_provider( + container: FlagdContainer, resolver_type, client_name, port +) -> OpenFeatureClient: + try: + container.get_exposed_port(port) + except: # noqa: E722 + container.start() + + path = ( + Path(__file__).parents[2] / "openfeature/test-harness/ssl/custom-root-cert.crt" + ) + + api.set_provider( + FlagdProvider( + resolver_type=resolver_type, + port=int(container.get_exposed_port(port)), + timeout=1, + retry_grace_period=3, + tls=True, + cert_path=str(path.absolute()), + ), + client_name, + ) + client = api.get_client(client_name) + wait_for(lambda: client.get_provider_status() == ProviderStatus.READY) + return client + + +scenarios( + f"{SPEC_PATH}/specification/assets/gherkin/evaluation.feature", +) diff --git a/providers/openfeature-provider-flagd/tests/test_errors.py b/providers/openfeature-provider-flagd/tests/test_errors.py index cc053788..3c8b4b1a 100644 --- a/providers/openfeature-provider-flagd/tests/test_errors.py +++ b/providers/openfeature-provider-flagd/tests/test_errors.py @@ -1,4 +1,5 @@ import os +import time import pytest @@ -6,6 +7,7 @@ from openfeature.contrib.provider.flagd import FlagdProvider from openfeature.contrib.provider.flagd.config import ResolverType from openfeature.evaluation_context import EvaluationContext +from openfeature.event import ProviderEvent from openfeature.exception import ErrorCode from openfeature.flag_evaluation import Reason @@ -84,3 +86,27 @@ def test_flag_disabled(): assert res.value == "fallback" assert res.reason == Reason.DISABLED + + +@pytest.mark.parametrize("wait", (500, 250)) +def test_grpc_sync_fail_deadline(wait: int): + init_failed = False + + def fail(*args, **kwargs): + nonlocal init_failed + init_failed = True + + api.get_client().add_handler(ProviderEvent.PROVIDER_ERROR, fail) + + t = time.time() + api.set_provider( + FlagdProvider( + resolver_type=ResolverType.IN_PROCESS, + port=99999, # dead port to test failure + deadline=wait, + ) + ) + + elapsed = time.time() - t + assert abs(elapsed - wait * 0.001) < 0.1 + assert init_failed diff --git a/providers/openfeature-provider-flagd/tests/test_file_store.py b/providers/openfeature-provider-flagd/tests/test_file_store.py index 5d07f62e..dea890ec 100644 --- a/providers/openfeature-provider-flagd/tests/test_file_store.py +++ b/providers/openfeature-provider-flagd/tests/test_file_store.py @@ -2,14 +2,14 @@ from unittest.mock import Mock import pytest -from src.openfeature.contrib.provider.flagd.resolvers.process.file_watcher import ( - FileWatcherFlagStore, -) -from src.openfeature.contrib.provider.flagd.resolvers.process.flags import Flag from openfeature import api from openfeature.contrib.provider.flagd import FlagdProvider -from openfeature.provider.provider import AbstractProvider +from openfeature.contrib.provider.flagd.config import Config +from openfeature.contrib.provider.flagd.resolvers.process.connector.file_watcher import ( + FileWatcher, +) +from openfeature.contrib.provider.flagd.resolvers.process.flags import Flag, FlagStore def create_client(provider: FlagdProvider): @@ -24,12 +24,23 @@ def create_client(provider: FlagdProvider): "basic-flag.yaml", ], ) -def test_file_load_errors(file_name: str): - provider = Mock(spec=AbstractProvider) +def test_file_load(file_name: str): + emit_provider_configuration_changed = Mock() + emit_provider_ready = Mock() + emit_provider_error = Mock() + flag_store = FlagStore(emit_provider_configuration_changed) path = os.path.abspath(os.path.join(os.path.dirname(__file__), "./flags/")) - file_store = FileWatcherFlagStore(f"{path}/{file_name}", provider) - - flag = file_store.flag_data.get("basic-flag") + file_watcher = FileWatcher( + Config( + offline_flag_source_path=f"{path}/{file_name}", + ), + flag_store, + emit_provider_ready, + emit_provider_error, + ) + file_watcher.initialize(None) + + flag = flag_store.get_flag("basic-flag") assert flag is not None assert isinstance(flag, Flag) diff --git a/providers/openfeature-provider-flagd/tests/test_grpc_sync_connector.py b/providers/openfeature-provider-flagd/tests/test_grpc_sync_connector.py new file mode 100644 index 00000000..95a35be7 --- /dev/null +++ b/providers/openfeature-provider-flagd/tests/test_grpc_sync_connector.py @@ -0,0 +1,45 @@ +import time +from unittest.mock import MagicMock, patch + +import pytest + +from openfeature.contrib.provider.flagd.config import Config +from openfeature.contrib.provider.flagd.resolvers.process.connector.grpc_watcher import ( + GrpcWatcher, +) +from openfeature.contrib.provider.flagd.resolvers.process.flags import FlagStore +from openfeature.exception import ProviderNotReadyError + + +def fake_grpc_service(flag_config: str, keepalive: int = 100): + def sync(request): + mock_resp = MagicMock() + mock_resp.flag_configuration = flag_config + yield mock_resp + time.sleep(keepalive) + + return sync + + +@pytest.mark.parametrize( + "flag_configuration", + ( + """{"flags": {"a-flag": {"garbage": "can"}}}""", + """not even a JSON""", + """{"flags": {"no-default": {"state": "ENABLED", "variants": {}}}}""", + ), +) +def test_invalid_payload(flag_configuration: str): + emit_provider_configuration_changed = MagicMock() + emit_provider_ready = MagicMock() + emit_provider_error = MagicMock() + flag_store = FlagStore(emit_provider_configuration_changed) + watcher = GrpcWatcher( + Config(deadline_ms=200), flag_store, emit_provider_ready, emit_provider_error + ) + + fake_sync_flags = fake_grpc_service(flag_configuration) + with patch.object(watcher.stub, "SyncFlags", fake_sync_flags), pytest.raises( + ProviderNotReadyError + ): + watcher.initialize(None) diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..28b2e68b --- /dev/null +++ b/renovate.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["github>open-feature/community-tooling"], + "pep621": { + "enabled": true + }, + "pre-commit": { + "enabled": true + } +}