mirror of
https://github.com/python/cpython.git
synced 2026-01-03 14:02:21 +00:00
gh-76007: Deprecate __version__ attribute in http.server (#142658)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
This commit is contained in:
parent
e02a35c365
commit
170dac291e
6 changed files with 26 additions and 5 deletions
|
|
@ -1560,6 +1560,16 @@ def test_https_client(self):
|
|||
self.assertEqual(res, self.served_data)
|
||||
|
||||
|
||||
class TestModule(unittest.TestCase):
|
||||
def test_deprecated__version__(self):
|
||||
with self.assertWarnsRegex(
|
||||
DeprecationWarning,
|
||||
"'__version__' is deprecated and slated for removal in Python 3.20",
|
||||
) as cm:
|
||||
getattr(http.server, "__version__")
|
||||
self.assertEqual(cm.filename, __file__)
|
||||
|
||||
|
||||
def setUpModule():
|
||||
unittest.addModuleCleanup(os.chdir, os.getcwd())
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue