Skip to content

Commit

Permalink
avoid calling config_logging in some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Jun 21, 2024
1 parent 682aa37 commit 9aa0b28
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyftpdlib/test/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.servers import FTPServer
from pyftpdlib.test import PyftpdlibTestCase
from pyftpdlib.test import mock


class TestCommandLineParser(PyftpdlibTestCase):
Expand All @@ -36,7 +37,6 @@ class DummyFTPServer(FTPServer):

def serve_forever(self, *args, **kwargs):
self.close_all()
return

if PY3:
import io
Expand All @@ -45,10 +45,12 @@ def serve_forever(self, *args, **kwargs):
else:
self.devnull = BytesIO()
self.original_ftpserver_class = FTPServer
self.clog = mock.patch("pyftpdlib.__main__.config_logging")
self.clog.start()
pyftpdlib.__main__.FTPServer = DummyFTPServer

def tearDown(self):
self.devnull.close()
self.clog.stop()
pyftpdlib.servers.FTPServer = self.original_ftpserver_class
super().tearDown()

Expand Down

0 comments on commit 9aa0b28

Please sign in to comment.