Skip to content

Commit

Permalink
Replace from termcolor to tcolorpy
Browse files Browse the repository at this point in the history
  • Loading branch information
thombashi committed Dec 12, 2020
1 parent 1e7f2a6 commit 278c00c
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ known_third_party = [
'pytest',
'pytz',
'sphinx_rtd_theme',
'termcolor',
'tcolorpy',
]
include_trailing_comma = true
line_length = 100
Expand Down
2 changes: 1 addition & 1 deletion requirements/test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pytest
termcolor
tcolorpy
4 changes: 2 additions & 2 deletions test/checker/test_checker_bool.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import itertools

import pytest
from termcolor import colored
from tcolorpy import tcolor

from typepy import Bool, StrictLevel, Typecode

Expand Down Expand Up @@ -36,7 +36,7 @@ def test_normal(self, value, strict_level, expected):

@pytest.mark.parametrize(
["value", "strip_ansi_escape", "expected"],
[[colored("True", "red"), False, False], [colored("True", "red"), True, True]],
[[tcolor("True", "red"), False, False], [tcolor("True", "red"), True, True]],
)
def test_normal_ansi(self, value, strip_ansi_escape, expected):
type_checker = class_under_test(value, StrictLevel.MIN, strip_ansi_escape=strip_ansi_escape)
Expand Down
6 changes: 3 additions & 3 deletions test/checker/test_checker_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import pytest
from dateutil.tz import tzoffset
from termcolor import colored
from tcolorpy import tcolor

from typepy import DateTime, StrictLevel, Typecode

Expand Down Expand Up @@ -66,8 +66,8 @@ def test_normal(self, value, strict_level, expected):
@pytest.mark.parametrize(
["value", "strip_ansi_escape", "expected"],
[
[colored("2017-03-22T10:00:00", "red"), False, False],
[colored("2017-03-22T10:00:00", "red"), True, True],
[tcolor("2017-03-22T10:00:00", "red"), False, False],
[tcolor("2017-03-22T10:00:00", "red"), True, True],
],
)
def test_normal_ansi(self, value, strip_ansi_escape, expected):
Expand Down
4 changes: 2 additions & 2 deletions test/checker/test_checker_integer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from decimal import Decimal

import pytest
from termcolor import colored
from tcolorpy import tcolor

from typepy import Integer, StrictLevel, Typecode

Expand Down Expand Up @@ -76,7 +76,7 @@ def test_normal(self, value, strict_level, expected):

@pytest.mark.parametrize(
["value", "strip_ansi_escape", "expected"],
[[colored("1", "red"), False, False], [colored("1", "red"), True, True]],
[[tcolor("1", "red"), False, False], [tcolor("1", "red"), True, True]],
)
def test_normal_ansi(self, value, strip_ansi_escape, expected):
type_checker = class_under_test(value, StrictLevel.MIN, strip_ansi_escape=strip_ansi_escape)
Expand Down
6 changes: 3 additions & 3 deletions test/checker/test_checker_ipaddress.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ipaddress import ip_address

import pytest
from termcolor import colored
from tcolorpy import tcolor

from typepy import IpAddress, StrictLevel, Typecode

Expand All @@ -20,7 +20,7 @@
class Test_IpAddress_is_type:
@pytest.mark.parametrize(
["value", "strict_level", "expected"],
[[colored("127.0.0.1", "red"), StrictLevel.MIN, True]]
[[tcolor("127.0.0.1", "red"), StrictLevel.MIN, True]]
+ list(
itertools.product(
["", " ", sys.maxsize, str(sys.maxsize), inf, nan, None],
Expand All @@ -46,7 +46,7 @@ def test_normal(self, value, strict_level, expected):

@pytest.mark.parametrize(
["value", "strip_ansi_escape", "expected"],
[[colored("127.0.0.1", "red"), False, False], [colored("127.0.0.1", "red"), True, True]],
[[tcolor("127.0.0.1", "red"), False, False], [tcolor("127.0.0.1", "red"), True, True]],
)
def test_normal_ansi(self, value, strip_ansi_escape, expected):
type_checker = class_under_test(value, StrictLevel.MIN, strip_ansi_escape=strip_ansi_escape)
Expand Down
4 changes: 2 additions & 2 deletions test/checker/test_checker_realnumber.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from decimal import Decimal

import pytest
from termcolor import colored
from tcolorpy import tcolor

from typepy import RealNumber, StrictLevel, Typecode

Expand Down Expand Up @@ -89,7 +89,7 @@ def test_normal(self, value, strict_level, expected):

@pytest.mark.parametrize(
["value", "strip_ansi_escape", "expected"],
[[colored("1.1", "red"), False, False], [colored("1.1", "red"), True, True]],
[[tcolor("1.1", "red"), False, False], [tcolor("1.1", "red"), True, True]],
)
def test_normal_ansi(self, value, strip_ansi_escape, expected):
type_checker = class_under_test(value, StrictLevel.MIN, strip_ansi_escape=strip_ansi_escape)
Expand Down

0 comments on commit 278c00c

Please sign in to comment.