From e9b36e1b6949acbad70530405ef47521969f320d Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Mon, 13 May 2024 14:24:28 -0400 Subject: [PATCH] TST: more py312 compatibility changes in tests --- .../tests/test_allowed_schemas.py | 4 ++++ .../tests/test_category_filtering.py | 20 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/jupyter_telemetry/tests/test_allowed_schemas.py b/jupyter_telemetry/tests/test_allowed_schemas.py index 6812b1e..ae12069 100644 --- a/jupyter_telemetry/tests/test_allowed_schemas.py +++ b/jupyter_telemetry/tests/test_allowed_schemas.py @@ -206,5 +206,9 @@ def test_allowed_schemas(schema, allowed_schemas, expected_output): allowed_schemas ) + # Cope with python3.12 + if "taskName" in event_data: + del event_data["taskName"] + # Verify that *exactly* the right properties are recorded. assert expected_output == event_data diff --git a/jupyter_telemetry/tests/test_category_filtering.py b/jupyter_telemetry/tests/test_category_filtering.py index ac86280..cf1f3a2 100644 --- a/jupyter_telemetry/tests/test_category_filtering.py +++ b/jupyter_telemetry/tests/test_category_filtering.py @@ -136,6 +136,10 @@ def test_category_filtering(allowed_schemas, expected_output): allowed_schemas ) + # Cope with python3.12 + if "taskName" in event_data: + del event_data["taskName"] + # Verify that *exactly* the right properties are recorded. assert expected_output == event_data @@ -291,6 +295,10 @@ def test_array_category_filtering(allowed_schemas, expected_output): allowed_schemas ) + # Cope with python3.12 + if "taskName" in event_data: + del event_data["taskName"] + # Verify that *exactly* the right properties are recorded. assert expected_output == event_data @@ -395,6 +403,10 @@ def test_no_additional_properties(allowed_schemas, expected_output): allowed_schemas ) + # Cope with python3.12 + if "taskName" in event_data: + del event_data["taskName"] + # Verify that *exactly* the right properties are recorded. assert expected_output == event_data @@ -488,6 +500,10 @@ def test_category_filtering_ref(allowed_schemas, expected_output): allowed_schemas ) + # Cope with python3.12 + if "taskName" in event_data: + del event_data["taskName"] + # Verify that *exactly* the right properties are recorded. assert expected_output == event_data @@ -504,5 +520,9 @@ def test_category_filtering_allof(allowed_schemas, expected_output): allowed_schemas ) + # Cope with python3.12 + if "taskName" in event_data: + del event_data["taskName"] + # Verify that *exactly* the right properties are recorded. assert expected_output == event_data