Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
default_stages: [pre-commit]
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.10
rev: v0.11.0
hooks:
- id: ruff
args: [--fix]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,8 @@ def from_dict(cls, key: str, data: dict) -> "Flag":
data["default_variant"] = data["defaultVariant"]
del data["defaultVariant"]

if "source" in data:
del data["source"]
if "selector" in data:
del data["selector"]
data.pop("source", None)
data.pop("selector", None)
try:
flag = cls(key=key, **data)
return flag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from openfeature.client import OpenFeatureClient
from openfeature.event import ProviderEvent

logger = logging.getLogger("openfeature.contrib.tests")

events = {
"ready": ProviderEvent.PROVIDER_READY,
"error": ProviderEvent.PROVIDER_ERROR,
Expand All @@ -28,7 +30,7 @@ def event_handles() -> list:
)
def add_event_handler(client: OpenFeatureClient, event_type: str, event_handles: list):
def handler(event):
logging.warning((event_type, event))
logger.warning((event_type, event))
event_handles.append(
{
"type": event_type,
Expand All @@ -38,7 +40,7 @@ def handler(event):

client.add_handler(events[event_type], handler)

logging.warning(("handler added", event_type))
logger.warning(("handler added", event_type))


def assert_handlers(handles, event_type: str, max_wait: int = 2):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

MERGED_FILE = "merged_file"

logger = logging.getLogger("openfeature.contrib.tests")


class TestProviderType(Enum):
UNAVAILABLE = "unavailable"
Expand Down Expand Up @@ -133,7 +135,7 @@ def fin():
try:
container.stop()
except: # noqa: E722 - we want to ensure all containers are stopped, even if we do have an exception here
logging.debug("container was not running anymore")
logger.debug("container was not running anymore")

# Teardown code
request.addfinalizer(fin)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import logging
import os

logger = logging.getLogger("openfeature.contrib.tests")


class TestFilter:
def __init__(self, config, feature_list=None, resolver=None, base_path=None):
Expand Down Expand Up @@ -40,7 +42,7 @@ def filter_items(self, items):
all_tags = self._get_item_tags(item)

# Debug: Print collected tags for each item
logging.debug(f"Item: {item.nodeid}, Tags: {all_tags}")
logger.debug(f"Item: {item.nodeid}, Tags: {all_tags}")

# Include-only logic: Skip items that do not match include_tags
if (
Expand Down