99
1010import pytest
1111
12+ from ddtrace .internal .compat import CURRENT_PY_VERSION
13+ from ddtrace .internal .compat import CURRENT_PY_VERSION_INFO
1214from ddtrace .internal .compat import NEXT_PY_UNSUPPORTED_MSG
1315from ddtrace .internal .compat import NEXT_PY_VERSION
1416from ddtrace .internal .compat import NEXT_PY_VERSION_INFO
@@ -23,6 +25,13 @@ def test_unsupported_msg_includes_running_version():
2325 assert NEXT_PY_UNSUPPORTED_MSG == _UNSUPPORTED_MSG
2426
2527
28+ def test_current_and_next_py_version_constants ():
29+ assert CURRENT_PY_VERSION == "3.15"
30+ assert CURRENT_PY_VERSION_INFO == (3 , 15 )
31+ assert NEXT_PY_VERSION == "3.16"
32+ assert NEXT_PY_VERSION_INFO == (3 , 16 )
33+
34+
2635def test_wrapping_modules_import ():
2736 import ddtrace .internal .bytecode_injection # noqa: F401
2837 import ddtrace .internal .module # noqa: F401
@@ -31,7 +40,7 @@ def test_wrapping_modules_import():
3140 import ddtrace .internal .wrapping .generators # noqa: F401
3241
3342
34- @pytest .mark .skipif (PYTHON_VERSION_INFO < NEXT_PY_VERSION_INFO , reason = f"{ NEXT_PY_VERSION } wrap() degrade" )
43+ @pytest .mark .skipif (PYTHON_VERSION_INFO < CURRENT_PY_VERSION_INFO , reason = f"{ CURRENT_PY_VERSION } wrap() degrade" )
3544def test_wrap_raises_not_implemented_on_315 ():
3645 from ddtrace .internal .wrapping import wrap
3746
@@ -45,7 +54,7 @@ def wrapper(wrapped, args, kwargs): # noqa: ANN001, ANN202
4554 wrap (f , wrapper )
4655
4756
48- @pytest .mark .skipif (PYTHON_VERSION_INFO < NEXT_PY_VERSION_INFO , reason = f"{ NEXT_PY_VERSION } lazy module degrade" )
57+ @pytest .mark .skipif (PYTHON_VERSION_INFO < CURRENT_PY_VERSION_INFO , reason = f"{ CURRENT_PY_VERSION } lazy module degrade" )
4958def test_lazy_module_decorator_without_bytecode_wrap ():
5059 import tests .internal .lazy as lazy_module
5160
@@ -62,7 +71,9 @@ def test_exec_lazy_init_without_source():
6271 assert module_globals ["exported" ] == 123
6372
6473
65- @pytest .mark .skipif (PYTHON_VERSION_INFO < NEXT_PY_VERSION_INFO , reason = f"{ NEXT_PY_VERSION } debugging products degrade" )
74+ @pytest .mark .skipif (
75+ PYTHON_VERSION_INFO < CURRENT_PY_VERSION_INFO , reason = f"{ CURRENT_PY_VERSION } debugging products degrade"
76+ )
6677def test_debugging_products_load_without_failure ():
6778 from ddtrace .internal .products import ProductManager
6879
@@ -77,7 +88,7 @@ def test_debugging_products_load_without_failure():
7788 assert product_name not in product_manager ._failed
7889
7990
80- @pytest .mark .skipif (PYTHON_VERSION_INFO < NEXT_PY_VERSION_INFO , reason = f"{ NEXT_PY_VERSION } inject_hook degrade" )
91+ @pytest .mark .skipif (PYTHON_VERSION_INFO < CURRENT_PY_VERSION_INFO , reason = f"{ CURRENT_PY_VERSION } inject_hook degrade" )
8192def test_inject_hook_raises_not_implemented_on_315 ():
8293 from ddtrace .internal .bytecode_injection import inject_hook
8394
0 commit comments