-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add disable_progress_bar option to disable tqdm. #427
add disable_progress_bar option to disable tqdm. #427
Conversation
* Add a disable_progress_bar option to settings. * Add a disable_progress_bar argument to init method of the repository. * Forward repository's disable_progress_bar property to tqdm ProgressBar as disable kwarg. * update README with help options for upload command.
Codecov Report
@@ Coverage Diff @@
## master #427 +/- ##
=========================================
+ Coverage 78.29% 80.1% +1.81%
=========================================
Files 14 14
Lines 751 754 +3
Branches 108 108
=========================================
+ Hits 588 604 +16
+ Misses 130 113 -17
- Partials 33 37 +4
Continue to review full report at Codecov.
|
* use mock instead of unittest.mock for python2.7 * Update tox.ini to depend on mock for py27 and pypy.
tests/test_repository.py
Outdated
@@ -16,7 +16,13 @@ | |||
from twine import repository | |||
from twine.utils import DEFAULT_REPOSITORY | |||
|
|||
try: | |||
from unittest import mock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This project doesn't use mock. Instead we use pretend which is already imported below and used throughout the test file. Please update your test to use that instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out I didn't need mock after all. Just replaced ProgressBar
with a context manager and it did the trick. Thanks!
replace ProgressBar with a contextmanager and assert on the args. No need for a mock object.
Add a disable_progress_bar option to settings.
Add a disable_progress_bar argument to init method of the repository.
Forward repository's disable_progress_bar property to
tqdm ProgressBar as disable kwarg.
update README with help options for upload command.
[x] ran tox -e lint
[x] ran tox against versions: 2.7, 3.6
[x] ran tox -e docs
[x] Added test to make sure tqdm is initialized with disable flag when repository is
initialized with disable_progress_bar parameter.
Closes #386