mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-19 17:14:43 +04:00
Revert "Add tests for NO_COLOR support"
This reverts commit 8520455042.
This commit is contained in:
parent
69b2cb5ea6
commit
e82c1e7259
1 changed files with 0 additions and 18 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
|
@ -51,20 +50,3 @@ def test_use_color_tty_without_color_support():
|
||||||
def test_use_color_raises_if_given_shenanigans():
|
def test_use_color_raises_if_given_shenanigans():
|
||||||
with pytest.raises(InvalidColorSetting):
|
with pytest.raises(InvalidColorSetting):
|
||||||
use_color('herpaderp')
|
use_color('herpaderp')
|
||||||
|
|
||||||
|
|
||||||
def test_no_color_env_unset():
|
|
||||||
with mock.patch.dict(os.environ):
|
|
||||||
if 'NO_COLOR' in os.environ:
|
|
||||||
del os.environ['NO_COLOR']
|
|
||||||
assert use_color('always') is True
|
|
||||||
|
|
||||||
|
|
||||||
def test_no_color_env_empty():
|
|
||||||
with mock.patch.dict(os.environ, NO_COLOR=''):
|
|
||||||
assert use_color('always') is True
|
|
||||||
|
|
||||||
|
|
||||||
def test_no_color_env_non_empty():
|
|
||||||
with mock.patch.dict(os.environ, NO_COLOR=' '):
|
|
||||||
assert use_color('always') is False
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue