Changeset 1660:93ea351f922b


Ignore:
Timestamp:
Jul 26, 2016, 9:38:34 PM (4 years ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
Message:
Remove `unittest.main` calls

Since we now use pytest as test runner and not a shell loop in the
makefile, there's no longer a need for explicit `unittest.main` calls.

ticket: 98
Location:
test
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • test/test_error.py

    r1646 r1660  
    9191          "Name or service not known" in str(exc))
    9292        del exc_info
    93 
    94 
    95 if __name__ == "__main__":
    96     unittest.main()
  • test/test_file.py

    r1647 r1660  
    230230        with pytest.raises(ftputil.error.FTPIOError):
    231231            host.open("notthere", "r")
    232 
    233 
    234 if __name__ == "__main__":
    235     unittest.main()
  • test/test_file_transfer.py

    r1648 r1660  
    121121        with pytest.raises(FailingStringIO.expected_exception):
    122122            next(iterator)
    123 
    124 
    125 if __name__ == "__main__":
    126     unittest.main()
  • test/test_host.py

    r1649 r1660  
    595595                with pytest.raises(TypeError):
    596596                    pickle.dumps(file_obj)
    597 
    598 
    599 if __name__ == "__main__":
    600     unittest.main()
    601     import __main__
    602     # unittest.main(__main__,
    603     #   "TestUploadAndDownload.test_conditional_upload")
  • test/test_path.py

    r1650 r1660  
    218218        host.path.walk("ä", noop, None)
    219219        host.path.walk(as_bytes("ä"), noop, None)
    220 
    221 
    222 if __name__ == "__main__":
    223     unittest.main()
  • test/test_public_servers.py

    r1651 r1660  
    176176                print(server, initial_directory)
    177177                self.inner_test_server(server, initial_directory, paths)
    178 
    179 
    180 if __name__ == "__main__":
    181     unittest.main()
  • test/test_real_ftp.py

    r1652 r1660  
    11# encoding: UTF-8
    2 
    32# Copyright (C) 2003-2016, Stefan Schwarzer <sschwarzer@sschwarzer.net>
    43# and ftputil contributors (see `doc/contributors.txt`)
     
    65
    76# Execute tests on a real FTP server (other tests use a mock server).
     7#
     8# This test writes some files and directories on the local client and
     9# the remote server. You'll need write access in the login directory.
     10# This test can take a few minutes because it has to wait to test the
     11# timezone calculation.
    812
    913from __future__ import absolute_import
     
    982986            files = host.listdir(".")
    983987        assert "CONTENTS" in files
    984 
    985 
    986 
    987 if __name__ == "__main__":
    988     print("""\
    989 Test real FTP access.
    990 
    991 This test writes some files and directories on the local client and
    992 the remote server. You'll need write access in the login directory.
    993 This test can take a few minutes because it has to wait to test the
    994 timezone calculation.
    995     """)
    996     unittest.main()
  • test/test_session.py

    r1653 r1660  
    142142                                 ("login", "user", "password"),
    143143                                 ("prot_p",)]
    144 
    145 
    146 if __name__ == "__main__":
    147     unittest.main()
  • test/test_stat.py

    r1655 r1660  
    538538        for file in expected:
    539539            assert file in remote_file_list
    540 
    541 
    542 if __name__ == "__main__":
    543     unittest.main()
  • test/test_stat_cache.py

    r1654 r1660  
    103103        items = host.listdir(host.curdir)
    104104        assert items[:3] == ["chemeng", "download", "image"]
    105 
    106 
    107 if __name__ == "__main__":
    108     unittest.main()
  • test/test_sync.py

    r1656 r1660  
    127127        # test framework will catch them and show them.
    128128        syncer.sync(local_root, "not_used_by_ArgumentCheckingFTPHost")
    129 
    130 
    131 if __name__ == "__main__":
    132     unittest.main()
  • test/test_tool.py

    r1657 r1660  
    6969        assert string == not_converted_string
    7070        assert isinstance(not_converted_string, compat.bytes_type)
    71 
    72 
    73 if __name__ == "__main__":
    74     unittest.main()
  • test/test_with_statement.py

    r1659 r1660  
    8787            else:
    8888                assert False, "`ClientCodeException` not raised"
    89 
    90 
    91 if __name__ == "__main__":
    92     unittest.main()
Note: See TracChangeset for help on using the changeset viewer.