stop

FunctionalityWrapper.stop()[source]

Stops the server, closes all the open ports and deletes all temp files. This is especially useful if you want to test if your code behaves gracefully, when the ftpserver isn’t reachable.

Warning

If pytest-localftpserver is run in ‘module’ (default) or ‘session’ scope, this should be the last test run using this fixture (in the given test module or suite), Since the server can’t be restarted.

Examples

>>> ftpserver.stop()
>>> your_code_connecting_to_the_ftp()
RuntimeError: Server is offline/ not reachable.