test: remove dead PR3068 workaround branch (#6109)
`WORKAROUND_ENABLING_ROLLBACK_OF_PR3068` compared the 5-element
`sys.version_info` tuple to `(3, 9)`, so it was always False. The guarded
branch never ran. Remove the constant and keep only the branch that runs.
Assisted-by: ClaudeCode:claude-opus-5
diff --git a/tests/test_class_sh_trampoline_shared_from_this.py b/tests/test_class_sh_trampoline_shared_from_this.py
index fbe3138..c59d0d1 100644
--- a/tests/test_class_sh_trampoline_shared_from_this.py
+++ b/tests/test_class_sh_trampoline_shared_from_this.py
@@ -1,6 +1,5 @@
from __future__ import annotations
-import sys
import weakref
import pytest
@@ -217,10 +216,6 @@
break # Comment out for manual leak checking (use `top` command).
-# As of 2021-07-10 the pybind11 GitHub Actions valgrind build uses Python 3.9.
-WORKAROUND_ENABLING_ROLLBACK_OF_PR3068 = env.LINUX and sys.version_info == (3, 9)
-
-
def test_std_make_shared_factory():
class PySftMakeShared(m.Sft):
def __init__(self, history):
@@ -228,19 +223,10 @@
obj = PySftMakeShared("PySftMakeShared")
assert obj.history == "PySftMakeShared"
- if WORKAROUND_ENABLING_ROLLBACK_OF_PR3068:
- try:
- m.pass_through_shd_ptr(obj)
- except RuntimeError as e:
- str_exc_info_value = str(e)
- else:
- str_exc_info_value = "RuntimeError NOT RAISED"
- else:
- with pytest.raises(RuntimeError) as exc_info:
- m.pass_through_shd_ptr(obj)
- str_exc_info_value = str(exc_info.value)
+ with pytest.raises(RuntimeError) as exc_info:
+ m.pass_through_shd_ptr(obj)
assert (
- str_exc_info_value
+ str(exc_info.value)
== "smart_holder_type_casters load_as_shared_ptr failure: not implemented:"
" trampoline-self-life-support for external shared_ptr to type inheriting"
" from std::enable_shared_from_this."