Skip to content

Commit

Permalink
Skip legacy entry_point tests on Python 3.13+ (#679)
Browse files Browse the repository at this point in the history
These tests require pkg_resources, which was removed in Python 3.13.
  • Loading branch information
cottsay authored Nov 28, 2024
1 parent 0ada5a7 commit bfe289c
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions test/test_entry_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,29 @@
# Licensed under the Apache License, Version 2.0

import os
import sys
from unittest.mock import Mock
from unittest.mock import patch
import warnings

import pytest

with warnings.catch_warnings():
warnings.filterwarnings(
'ignore', message='.*entry_point.*deprecated.*', category=UserWarning)

from colcon_core.entry_point import EXTENSION_POINT_GROUP_NAME
from colcon_core.entry_point import get_all_entry_points
from colcon_core.entry_point import get_entry_points
from colcon_core.entry_point import load_entry_point
from colcon_core.entry_point import load_entry_points

import pytest
try:
from colcon_core.entry_point import EXTENSION_POINT_GROUP_NAME
from colcon_core.entry_point import get_all_entry_points
from colcon_core.entry_point import get_entry_points
from colcon_core.entry_point import load_entry_point
from colcon_core.entry_point import load_entry_points
except ModuleNotFoundError:
if sys.version_info >= (3, 13):
pytest.skip(
'pkg_resources is no longer available in Python 3.13+',
allow_module_level=True)
raise

from .environment_context import EnvironmentContext

Expand Down

0 comments on commit bfe289c

Please sign in to comment.