Automatic release update warnings. (#1336)

* Hide pretty help

* Automatic release update warnings.

* `httpie cli check-updates`

* adapt to the new loglevel construct

* Don't make the pie-colors the bold

* Apply review feedback.

Co-authored-by: Jakub Roztocil <jakub@roztocil.co>
This commit is contained in:
Batuhan TaskayaandJakub Roztocil authored and GitHub committed 2022-05-05 11:18:20 -07:00
1 parent f9b5c2f696
commit 003f2095d4
21 files changed
+708 -36

No files matched your search

+10 -3
View File
@@ -49,6 +49,10 @@ HTTP_OK_COLOR = (
DUMMY_URL = 'http://this-should.never-resolve' # Note: URL never fetched
DUMMY_HOST = url_as_host(DUMMY_URL)
# We don't want hundreds of subprocesses trying to access GitHub API
# during the tests.
Config.DEFAULTS['disable_update_warnings'] = True
def strip_colors(colorized_msg: str) -> str:
return COLOR_RE.sub('', colorized_msg)
@@ -163,6 +167,7 @@ class MockEnvironment(Environment):
self._delete_config_dir = True
def cleanup(self):
self.devnull.close()
self.stdout.close()
self.stderr.close()
warnings.resetwarnings()
@@ -179,6 +184,11 @@ class MockEnvironment(Environment):
pass
class PersistentMockEnvironment(MockEnvironment):
def cleanup(self):
pass
class BaseCLIResponse:
"""
Represents the result of simulated `$ http' invocation via `http()`.
@@ -442,7 +452,4 @@ def http(
return r
finally:
devnull.close()
stdout.close()
stderr.close()
env.cleanup()