summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_platform.py
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2015-05-13 09:32:20 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2015-05-13 09:32:20 (GMT)
commit2f3742b0d8dbe025f2f9e496938a6d344e6881ad (patch)
tree480fc929c731bf5081552dec4e3ff730144c82fa /Lib/test/test_platform.py
parentde7cafaa63db3849d11b1d17195ee23eacad7325 (diff)
downloadcpython-2f3742b0d8dbe025f2f9e496938a6d344e6881ad.zip
cpython-2f3742b0d8dbe025f2f9e496938a6d344e6881ad.tar.gz
cpython-2f3742b0d8dbe025f2f9e496938a6d344e6881ad.tar.bz2
Issue #1322: platform.dist() and platform.linux_distribution() functions are now deprecated.
Initial patch by Vajrasky Kok.
Diffstat (limited to 'Lib/test/test_platform.py')
-rw-r--r--Lib/test/test_platform.py24
1 files changed, 19 insertions, 5 deletions
diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py
index ededbdb..f4ce36d 100644
--- a/Lib/test/test_platform.py
+++ b/Lib/test/test_platform.py
@@ -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()