Skip to content

Commit

Permalink
Drop unittest usage in favour of pytest.
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed May 19, 2024
1 parent 7ecfb43 commit eff1ef2
Show file tree
Hide file tree
Showing 207 changed files with 2,597 additions and 3,905 deletions.
7 changes: 1 addition & 6 deletions colour/adaptation/tests/test__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# !/usr/bin/env python
"""Define the unit tests for the :mod:`colour.adaptation` module."""

import unittest

import numpy as np

Expand All @@ -21,7 +20,7 @@
]


class TestChromaticAdaptation(unittest.TestCase):
class TestChromaticAdaptation:
"""
Define :func:`colour.adaptation.chromatic_adaptation` definition unit
tests methods.
Expand Down Expand Up @@ -122,7 +121,3 @@ def test_domain_range_scale_chromatic_adaptation(self):
value * factor,
atol=TOLERANCE_ABSOLUTE_TESTS,
)


if __name__ == "__main__":
unittest.main()
7 changes: 1 addition & 6 deletions colour/adaptation/tests/test_cie1994.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# !/usr/bin/env python
"""Define the unit tests for the :mod:`colour.adaptation.cie1994` module."""

import unittest
from itertools import product

import numpy as np
Expand All @@ -22,7 +21,7 @@
]


class TestChromaticAdaptationCIE1994(unittest.TestCase):
class TestChromaticAdaptationCIE1994:
"""
Define :func:`colour.adaptation.cie1994.chromatic_adaptation_CIE1994`
definition unit tests methods.
Expand Down Expand Up @@ -161,7 +160,3 @@ def test_nan_chromatic_adaptation_CIE1994(self):
cases[..., 0],
cases[..., 0],
)


if __name__ == "__main__":
unittest.main()
9 changes: 2 additions & 7 deletions colour/adaptation/tests/test_cmccat2000.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# !/usr/bin/env python
"""Define the unit tests for the :mod:`colour.adaptation.cmccat2000."""

import unittest
from itertools import product

import numpy as np
Expand All @@ -26,7 +25,7 @@
]


class TestChromaticAdaptationForwardCMCCAT2000(unittest.TestCase):
class TestChromaticAdaptationForwardCMCCAT2000:
"""
Define :func:`colour.adaptation.cmccat2000.\
chromatic_adaptation_forward_CMCCAT2000` definition unit tests methods.
Expand Down Expand Up @@ -161,7 +160,7 @@ def test_nan_chromatic_adaptation_forward_CMCCAT2000(self):
)


class TestChromaticAdaptationInverseCMCCAT2000(unittest.TestCase):
class TestChromaticAdaptationInverseCMCCAT2000:
"""
Define :func:`colour.adaptation.cmccat2000.\
chromatic_adaptation_inverse_CMCCAT2000` definition unit tests methods.
Expand Down Expand Up @@ -294,7 +293,3 @@ def test_nan_chromatic_adaptation_inverse_CMCCAT2000(self):
chromatic_adaptation_inverse_CMCCAT2000(
cases, cases, cases, cases[..., 0], cases[..., 0]
)


if __name__ == "__main__":
unittest.main()
7 changes: 1 addition & 6 deletions colour/adaptation/tests/test_fairchild1990.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"""Define the unit tests for the :mod:`colour.adaptation.fairchild1990` module."""

import contextlib
import unittest
from itertools import product

import numpy as np
Expand All @@ -24,7 +23,7 @@
]


class TestChromaticAdaptationFairchild1990(unittest.TestCase):
class TestChromaticAdaptationFairchild1990:
"""
Define :func:`colour.adaptation.fairchild1990.\
chromatic_adaptation_Fairchild1990` definition unit tests methods.
Expand Down Expand Up @@ -148,7 +147,3 @@ def test_nan_chromatic_adaptation_Fairchild1990(self):
Y_n = case[0]
with contextlib.suppress(LinAlgError):
chromatic_adaptation_Fairchild1990(XYZ_1, XYZ_n, XYZ_r, Y_n)


if __name__ == "__main__":
unittest.main()
9 changes: 2 additions & 7 deletions colour/adaptation/tests/test_vonkries.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# !/usr/bin/env python
"""Define the unit tests for the :mod:`colour.adaptation.vonkries` module."""

import unittest
from itertools import product

import numpy as np
Expand All @@ -26,7 +25,7 @@
]


class TestMatrixChromaticAdaptationVonKries(unittest.TestCase):
class TestMatrixChromaticAdaptationVonKries:
"""
Define :func:`colour.adaptation.vonkries.\
matrix_chromatic_adaptation_VonKries` definition unit tests methods.
Expand Down Expand Up @@ -192,7 +191,7 @@ def test_nan_matrix_chromatic_adaptation_VonKries(self):
matrix_chromatic_adaptation_VonKries(cases, cases)


class TestChromaticAdaptationVonKries(unittest.TestCase):
class TestChromaticAdaptationVonKries:
"""
Define :func:`colour.adaptation.vonkries.chromatic_adaptation_VonKries`
definition unit tests methods.
Expand Down Expand Up @@ -330,7 +329,3 @@ def test_nan_chromatic_adaptation_VonKries(self):
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
chromatic_adaptation_VonKries(cases, cases, cases)


if __name__ == "__main__":
unittest.main()
7 changes: 1 addition & 6 deletions colour/adaptation/tests/test_zhai2018.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# !/usr/bin/env python
"""Define the unit tests for the :mod:`colour.adaptation.zhai2018` module."""

import unittest
from itertools import product

import numpy as np
Expand All @@ -22,7 +21,7 @@
]


class TestChromaticAdaptationZhai2018(unittest.TestCase):
class TestChromaticAdaptationZhai2018:
"""
Define :func:`colour.adaptation.zhai2018.chromatic_adaptation_Zhai2018`
definition unit tests methods.
Expand Down Expand Up @@ -175,7 +174,3 @@ def test_nan_chromatic_adaptation_Zhai2018(self):
chromatic_adaptation_Zhai2018(
cases, cases, cases, cases[0, 0], cases[0, 0], cases
)


if __name__ == "__main__":
unittest.main()
17 changes: 6 additions & 11 deletions colour/algebra/coordinates/tests/test_transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:mod:`colour.algebra.coordinates.transformations` module.
"""

import unittest
from itertools import product

import numpy as np
Expand Down Expand Up @@ -36,7 +35,7 @@
]


class TestCartesianToSpherical(unittest.TestCase):
class TestCartesianToSpherical:
"""
Define :func:`colour.algebra.coordinates.transformations.\
cartesian_to_spherical` definition unit tests methods.
Expand Down Expand Up @@ -99,7 +98,7 @@ def test_nan_cartesian_to_spherical(self):
cartesian_to_spherical(cases)


class TestSphericalToCartesian(unittest.TestCase):
class TestSphericalToCartesian:
"""
Define :func:`colour.algebra.coordinates.transformations.\
spherical_to_cartesian` definition unit tests methods.
Expand Down Expand Up @@ -162,7 +161,7 @@ def test_nan_spherical_to_cartesian(self):
spherical_to_cartesian(cases)


class TestCartesianToPolar(unittest.TestCase):
class TestCartesianToPolar:
"""
Define :func:`colour.algebra.coordinates.transformations.\
cartesian_to_polar` definition unit tests methods.
Expand Down Expand Up @@ -225,7 +224,7 @@ def test_nan_cartesian_to_polar(self):
cartesian_to_polar(cases)


class TestPolarToCartesian(unittest.TestCase):
class TestPolarToCartesian:
"""
Define :func:`colour.algebra.coordinates.transformations.\
polar_to_cartesian` definition unit tests methods.
Expand Down Expand Up @@ -288,7 +287,7 @@ def test_nan_polar_to_cartesian(self):
polar_to_cartesian(cases)


class TestCartesianToCylindrical(unittest.TestCase):
class TestCartesianToCylindrical:
"""
Define :func:`colour.algebra.coordinates.transformations.\
cartesian_to_cylindrical` definition unit tests methods.
Expand Down Expand Up @@ -351,7 +350,7 @@ def test_nan_cartesian_to_cylindrical(self):
cartesian_to_cylindrical(cases)


class TestCylindricalToCartesian(unittest.TestCase):
class TestCylindricalToCartesian:
"""
Define :func:`colour.algebra.coordinates.transformations.\
cylindrical_to_cartesian` definition unit tests methods.
Expand Down Expand Up @@ -412,7 +411,3 @@ def test_nan_cylindrical_to_cartesian(self):
cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
cases = np.array(list(set(product(cases, repeat=3))))
cylindrical_to_cartesian(cases)


if __name__ == "__main__":
unittest.main()

0 comments on commit eff1ef2

Please sign in to comment.