Changeset 2064:b5f89833bc4d


Ignore:
Timestamp:
Mar 17, 2021, 10:58:50 PM (9 months ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
Message:
Use `super` for base class constructor call

I don't know why this didn't work before. Maybe I had mocked
`ftplib.FTP` instead of `ftplib.FTP.__init__`?

ticket: 145
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ftputil/host.py

    r2063 r2064  
    5050            if "encoding" not in kwargs:
    5151                kwargs["encoding"] = ftputil.path_encoding.DEFAULT_ENCODING
    52             # Use a "classic" base class call. If using a `super` call, this is
    53             # much more tricky to test with the current mocking approach.
    54             ftplib.FTP.__init__(self, *args, **kwargs)
     52            super().__init__(*args, **kwargs)
    5553
    5654
  • test/test_host.py

    r2063 r2064  
    9292                # Don't compare the `self` argument. It changes for every test
    9393                # run.
    94                 ftp_mock.call_args.args[1:]
     94                ftp_mock.call_args.args
    9595                == ("localhost", "ftptest", "dummy") + args
    9696            )
Note: See TracChangeset for help on using the changeset viewer.