Skip to content

Commit e2a1308

Browse files
committed
reduce socket timeout
1 parent 5562d59 commit e2a1308

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

tests/test_ftpfs.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,22 @@
33
from __future__ import print_function
44
from __future__ import unicode_literals
55

6-
import threading
6+
import socket
77
import ftplib
88
import os
99
import platform
1010
import shutil
11-
import subprocess
12-
import sys
1311
import tempfile
1412
import time
1513
import unittest
1614
import uuid
1715

1816
from six import text_type
19-
from six.moves.urllib.request import urlopen
2017

2118
from ftplib import error_perm
2219
from ftplib import error_temp
2320

2421
from pyftpdlib.authorizers import DummyAuthorizer
25-
from pyftpdlib.handlers import FTPHandler
2622

2723
from fs import errors
2824
from fs.opener import open_fs
@@ -32,6 +28,10 @@
3228
from nose.plugins.attrib import attr
3329

3430

31+
# Prevent socket timeouts from slowing tests too much
32+
socket.setdefaulttimeout(1)
33+
34+
3535
class TestFTPFSClass(unittest.TestCase):
3636

3737
def test_parse_ftp_time(self):
@@ -133,7 +133,7 @@ def test_ftp_url(self):
133133
def test_host(self):
134134
self.assertEqual(self.fs.host, self.server.host)
135135

136-
@attr('slow')
136+
#@attr('slow')
137137
def test_connection_error(self):
138138
fs = FTPFS('ftp.not.a.chance', timeout=1)
139139
with self.assertRaises(errors.RemoteConnectionError):

0 commit comments

Comments
 (0)