andreafrancia / trash-cli

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

tests: make use of the stdlib unittest.mock for python 3.3+ #346

Closed eli-schwartz closed 3 months ago

eli-schwartz commented 3 months ago

Fixes: #339

I don't really like the idea of a "compat" module but if one must...

andreafrancia commented 3 months ago

Test does not pass.

eli-schwartz commented 3 months ago

@andreafrancia please reopen this PR so that I can make the trivial typo fix for the tests.

eli-schwartz commented 3 months ago

failed 5 minutes ago in 13s

Does not give me a whole lot of time to look at CI results and try to fix them... github does not run CI automatically so I did not have a chance to see this issue until right now.

andreafrancia commented 3 months ago

You could run pip install on a clean python 2.7 virtual environment. To install Python 2.7 you can use pyenv. To create a virtual environment you can use virtualenv

I prefer not to keep open the PR because I can't know how much time will pass before a contributor make the following push. But I think you can keep pushing code.

In any case you can fork and activate Actions on your repository, I don't need any of my approval to craft a commit that passes all the tests on this trash-cli repository.

eli-schwartz commented 3 months ago

I prefer not to keep open the PR because I can't know how much time will pass before a contributor make the following push. But I think you can keep pushing code.

If you push to a closed PR then GitHub does not let you re-open it until you restore the exact commit sha1 that was the HEAD commit for the PR at the time the PR was closed. It's a huge hassle and requires reverting any pushes anyway.

For faster turnaround, it's advisable to override GitHub's default setting -- which doesn't run CI for any first time contributor -- to instead just skip running for "new GitHub users". The purpose of this setting is actually because once upon a time GitHub simply ran CI all the time, but people started spamming GitHub by creating dummy accounts and creating PRs to add Bitcoin miners. There is no implied or explicit problem with automatically running CI by first time contributors to a project that are also longstanding GitHub users (I've had a GitHub account for a decade and made thousands of contributions to one project or another per year, so GitHub knows very well I'm not a spam account auto created by a Bitcoin bot). Unfortunately, GitHub just has horribly bad default settings. :(

Anyway, I am definitely available today to make additional pushes, no worries.

andreafrancia commented 2 months ago

I'm not changing the default settings. Please do test your code before sending a pull request.

eli-schwartz commented 2 months ago

I'm not changing the default settings.

You're shooting yourself in the foot, but fine.

Please do test your code before sending a pull request.

I did. The code passed all tests.

The github actions integration didn't.

eli-schwartz commented 2 months ago

I prefer not to keep open the PR because I can't know how much time will pass before a contributor make the following push.

I got tired of waiting. #347