aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Touhey <thomas@touhey.fr>2019-05-06 12:33:42 +0200
committerThomas Touhey <thomas@touhey.fr>2019-05-06 12:33:42 +0200
commit905958910dd4fe9926244c990d405789e063ed75 (patch)
treed38f49510e9e6b288c9eb59824ca8e765bd2de20
parentbf4bb84d94a5855799d4638f7fe24c0891a89588 (diff)
Corrected test format.
-rw-r--r--.gitignore1
-rwxr-xr-xtests/test_rgba.py (renamed from tests/test_all.py)6
2 files changed, 3 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index 868792e..8f69dec 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,4 @@ __pycache__
/docs/_build
/venv
/README.html
+/.pytest_cache
diff --git a/tests/test_all.py b/tests/test_rgba.py
index 73fa900..6781aa8 100755
--- a/tests/test_all.py
+++ b/tests/test_rgba.py
@@ -8,7 +8,7 @@
import pytest
from thcolor import Color
-_rgbcolors = (
+@pytest.mark.parametrize('test_input,expected', (
('blue', ( 0, 0, 255, 1.0)),
('#12345F', ( 18, 52, 95, 1.0)),
('#123', ( 17, 34, 51, 1.0)),
@@ -18,9 +18,7 @@ _rgbcolors = (
(' rgb (1,22, 242 , 50.0% )', ( 1, 22, 242, 0.5)),
('rgba(1,22,242,0.500)', ( 1, 22, 242, 0.5)),
('rbga(5, 7)', ( 5, 0, 7, 1.0)),
- ('hsl(0, 1,50.0%)', (255, 0, 0, 1.0)))
-
-@pytest.mark.parametrize('test_input,expected', _rgbcolors)
+ ('hsl(0, 1,50.0%)', (255, 0, 0, 1.0))))
def test_rgba(test_input, expected):
assert Color.from_text(test_input).rgba() == expected