mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Issue #1322: platform.dist() and platform.linux_distribution() functions are now deprecated.
Initial patch by Vajrasky Kok.
This commit is contained in:
parent
de7cafaa63
commit
2f3742b0d8
5 changed files with 47 additions and 8 deletions
|
|
@ -311,10 +311,24 @@ class PlatformTest(unittest.TestCase):
|
|||
self.assertEqual(version, '19')
|
||||
self.assertEqual(distid, 'Schr\xf6dinger\u2019s Cat')
|
||||
|
||||
def test_main():
|
||||
support.run_unittest(
|
||||
PlatformTest
|
||||
)
|
||||
|
||||
class DeprecationTest(unittest.TestCase):
|
||||
|
||||
def test_dist_deprecation(self):
|
||||
with self.assertWarns(PendingDeprecationWarning) as cm:
|
||||
platform.dist()
|
||||
self.assertEqual(str(cm.warning),
|
||||
'dist() and linux_distribution() functions are '
|
||||
'deprecated in Python 3.5 and will be removed in '
|
||||
'Python 3.7')
|
||||
|
||||
def test_linux_distribution_deprecation(self):
|
||||
with self.assertWarns(PendingDeprecationWarning) as cm:
|
||||
platform.linux_distribution()
|
||||
self.assertEqual(str(cm.warning),
|
||||
'dist() and linux_distribution() functions are '
|
||||
'deprecated in Python 3.5 and will be removed in '
|
||||
'Python 3.7')
|
||||
|
||||
if __name__ == '__main__':
|
||||
test_main()
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue