summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ftplib.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2013-02-19 23:32:28 (GMT)
committerR David Murray <rdmurray@bitdance.com>2013-02-19 23:32:28 (GMT)
commit87632f1a9ec1dd310df1b0addc4c8842d83828bf (patch)
tree4f750a791e5dbf931ce9caead5d738043b4b5f00 /Lib/test/test_ftplib.py
parent8aa164b395d785598b0708644a6802b71d78660c (diff)
downloadcpython-87632f1a9ec1dd310df1b0addc4c8842d83828bf.zip
cpython-87632f1a9ec1dd310df1b0addc4c8842d83828bf.tar.gz
cpython-87632f1a9ec1dd310df1b0addc4c8842d83828bf.tar.bz2
#6623: Add explicit deprecation warning for ftplib.Netrc.
Diffstat (limited to 'Lib/test/test_ftplib.py')
-rw-r--r--Lib/test/test_ftplib.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py
index 4dfc457..2e89973 100644
--- a/Lib/test/test_ftplib.py
+++ b/Lib/test/test_ftplib.py
@@ -985,8 +985,19 @@ class TestTimeouts(TestCase):
ftp.close()
+class TestNetrcDeprecation(TestCase):
+
+ def test_deprecation(self):
+ with support.temp_cwd(), support.EnvironmentVarGuard() as env:
+ env['HOME'] = os.getcwd()
+ open('.netrc', 'w').close()
+ with self.assertWarns(DeprecationWarning):
+ ftplib.Netrc()
+
+
+
def test_main():
- tests = [TestFTPClass, TestTimeouts]
+ tests = [TestFTPClass, TestTimeouts, TestNetrcDeprecation]
if support.IPV6_ENABLED:
tests.append(TestIPv6Environment)