diff --git a/src/pyramid/scripts/pshell.py b/src/pyramid/scripts/pshell.py index 4d3817ffb..a3840c317 100644 --- a/src/pyramid/scripts/pshell.py +++ b/src/pyramid/scripts/pshell.py @@ -193,7 +193,7 @@ def setup_env(self): if k not in orig_env or v is not orig_env[k]: if getattr(v, '__doc__', False): env_help[k] = v.__doc__.replace("\n", " ") - else: + else: # pragma: nocover -- Python >= 3.13 always has a __doc__ env_help[k] = v del orig_env diff --git a/tests/test_util.py b/tests/test_util.py index bf4c08988..24f34a0fe 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -1,5 +1,6 @@ import sys import unittest +import pytest from pyramid.util import bytes_, text_ @@ -66,13 +67,10 @@ def worker(obj): self.assertEqual(1, foo.y) def test_property_without_name(self): - def worker(obj): # pragma: no cover - pass - foo = Dummy() helper = self._getTargetClass() self.assertRaises( - ValueError, helper.set_property, foo, property(worker) + ValueError, helper.set_property, foo, "has_no___name__" ) def test_property_with_name(self): @@ -271,11 +269,8 @@ def worker(obj): self.assertEqual(1, foo.y) def test_property_without_name(self): - def worker(obj): # pragma: no cover - pass - foo = self._makeOne() - self.assertRaises(ValueError, foo.set_property, property(worker)) + self.assertRaises(ValueError, foo.set_property, "has_no___name__") def test_property_with_name(self): def worker(obj):