andreafrancia / trash-cli

Command line interface to the freedesktop.org trashcan.
GNU General Public License v2.0
3.53k stars 177 forks source link

replace old mock by the new unittest.mock #331

Closed a-detiste closed 3 months ago

andreafrancia commented 3 months ago

Thank you for your contribution but I'm still using the old mock library to keep trash-cli compatible with python 2.7

a-detiste commented 3 months ago

No problem.

Would you accept to hybridize mock usage ?

Like this:

try: from unittest import mock except ImportError: import mock

We are slowly trying to remove mock,nose,unittest2,future etc... from Debian; so what is done is done :-)

Le jeu. 28 mars 2024 à 12:27, Andrea Francia @.***> a écrit :

Thank you for your contribution but I'm still using the old mock library to keep trash-cli compatible with python 2.7

— Reply to this email directly, view it on GitHub https://github.com/andreafrancia/trash-cli/pull/331#issuecomment-2024958427, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB47WUGAGZUZYU7ZBKTPG6TY2PWA7AVCNFSM6AAAAABCDJAI5WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRUHE2TQNBSG4 . You are receiving this because you authored the thread.Message ID: @.***>

andreafrancia commented 3 months ago

Yes, but this code should be put in single place. We already have code like this:

from trashcli.compat import Protocol

If you want can make it works also for Mock and call, something like

from trashcli.compat import Mock
from trashcli.compat import call

Thank you