Skip to content

Commit 5234d70

Browse files
committed
-Remove pytest.ini.
-Remove pytest component of pyproject.toml. -Conform tests to pytest naming convention. Signed-off-by: Mei Chu <[email protected]>
1 parent 9f8de97 commit 5234d70

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+221
-240
lines changed

pyproject.toml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,3 @@ before-build = "share/ci/scripts/macos/install_docs_env.sh"
3232

3333
[tool.cibuildwheel.windows]
3434
before-build = "bash -c share/ci/scripts/windows/install_docs_env.sh"
35-
36-
[tool.pytest.ini_options]
37-
python_files = "*Test.py"
38-
python_classes = "Test"
39-
python_functions = "test_*"
40-
addopts = ["--disable-warnings"]
41-
testpaths = ["tests/python"]

pytest.ini

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/python/AllocationTransformTest.py renamed to tests/python/test_AllocationTransform.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
import unittest
55

66
import PyOpenColorIO as OCIO
7-
from TransformsBaseTest import TransformsBaseTest
7+
from test_TransformsBase import TransformsBaseTest
88

99

10-
class AllocationTransformTest(unittest.TestCase, TransformsBaseTest):
10+
class TestAllocationTransform(unittest.TestCase, TransformsBaseTest):
1111
TEST_ALLOCATION = OCIO.ALLOCATION_LG2
1212
TEST_VARS = [0, 1]
1313
TEST_DIRECTION = OCIO.TRANSFORM_DIR_INVERSE

tests/python/BakerTest.py renamed to tests/python/test_Baker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import copy, unittest, os, sys
77
import PyOpenColorIO as OCIO
88

9-
class BakerTest(unittest.TestCase):
9+
class TestBaker(unittest.TestCase):
1010

1111
SIMPLE_PROFILE = """ocio_profile_version: 1
1212

tests/python/BuiltinConfigRegistryTest.py renamed to tests/python/test_BuiltinConfigRegistry.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
import PyOpenColorIO as OCIO
1515

16-
class BuiltinConfigRegistryTest(unittest.TestCase):
16+
class TestBuiltinConfigRegistry(unittest.TestCase):
1717
# BuiltinRegistry singleton.
1818
REGISTRY = None
1919

@@ -27,7 +27,7 @@ def test_builtin_config_iterable(self):
2727
self.assertIsInstance(name, STRING_TYPES)
2828
self.assertIsInstance(self.REGISTRY[name], STRING_TYPES)
2929
all_names.append(name)
30-
30+
3131
# All names were iterated over, and __len__ and list() behave.
3232
self.assertEqual(len(all_names), len(self.REGISTRY))
3333
self.assertListEqual(all_names, list(self.REGISTRY))
@@ -38,7 +38,7 @@ def test_builtin_config_iterable(self):
3838

3939
# Iterator size is available.
4040
self.assertEqual(len(iterator), len(self.REGISTRY))
41-
41+
4242
# Iterator supports range-based loop and indexing.
4343
values = list(iterator)
4444
for i in range(len(iterator)):
@@ -83,7 +83,7 @@ def test_get_builtin_configs(self):
8383

8484
# Iterator size is available.
8585
self.assertEqual(len(iterator), len(self.REGISTRY))
86-
86+
8787
# Iterator supports range-based loop and indexing.
8888
values = list(iterator)
8989
for i in range(len(iterator)):
@@ -117,7 +117,7 @@ def test_get_builtin_configs(self):
117117
self.assertEqual(values[0][0], "cg-config-v1.0.0_aces-v1.3_ocio-v2.1")
118118
# UI name
119119
self.assertEqual(
120-
values[0][1],
120+
values[0][1],
121121
("Academy Color Encoding System - CG Config [COLORSPACES v1.0.0] [ACES v1.3] "
122122
"[OCIO v2.1]"))
123123
# isRecommended
@@ -128,20 +128,20 @@ def test_get_builtin_configs(self):
128128
self.assertEqual(values[1][0], "studio-config-v1.0.0_aces-v1.3_ocio-v2.1")
129129
# UI name
130130
self.assertEqual(
131-
values[1][1],
131+
values[1][1],
132132
("Academy Color Encoding System - Studio Config [COLORSPACES v1.0.0] [ACES v1.3] "
133133
"[OCIO v2.1]"))
134134
# isRecommended
135135
self.assertEqual(values[1][2], True)
136136

137137
def test_multi_reference(self):
138-
# Registry is a singleton. Make sure multiple Python
138+
# Registry is a singleton. Make sure multiple Python
139139
# instances can be held.
140140
instances = []
141141
for i in range(10):
142142
instances.append(OCIO.BuiltinConfigRegistry())
143143

144-
# Other instances should still function after deleting one. The
144+
# Other instances should still function after deleting one. The
145145
# underlying C++ object is not deleted.
146146
instance_0 = instances.pop(0)
147147
self.assertEqual(len(instances), 9)
@@ -151,7 +151,7 @@ def test_multi_reference(self):
151151
with self.assertRaises(NameError):
152152
len(instance_0)
153153

154-
# Test underlying C++ reference validity by accessing registry
154+
# Test underlying C++ reference validity by accessing registry
155155
# data for each instance.
156156
for instance in instances:
157157
self.assertGreaterEqual(len(instance), 1)

tests/python/BuiltinTransformTest.py renamed to tests/python/test_BuiltinTransform.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
import unittest
55

66
import PyOpenColorIO as OCIO
7-
from TransformsBaseTest import TransformsBaseTest
7+
from test_TransformsBase import TransformsBaseTest
88

99

10-
class BuiltinTransformTest(unittest.TestCase, TransformsBaseTest):
10+
class TestBuiltinTransform(unittest.TestCase, TransformsBaseTest):
1111
# BuiltinTransformRegistry singleton
1212
REGISTRY = None
1313

@@ -61,7 +61,7 @@ def test_constructor_keyword(self):
6161

6262
self.assertEqual(builtin_tr1.getStyle(), self.EXAMPLE_STYLE)
6363
self.assertEqual(builtin_tr1.getDescription(), self.EXAMPLE_DESC)
64-
self.assertEqual(builtin_tr1.getDirection(),
64+
self.assertEqual(builtin_tr1.getDirection(),
6565
OCIO.TRANSFORM_DIR_FORWARD)
6666

6767
# Keyword args out of order
@@ -70,17 +70,17 @@ def test_constructor_keyword(self):
7070

7171
self.assertEqual(builtin_tr2.getStyle(), self.EXAMPLE_STYLE)
7272
self.assertEqual(builtin_tr2.getDescription(), self.EXAMPLE_DESC)
73-
self.assertEqual(builtin_tr2.getDirection(),
73+
self.assertEqual(builtin_tr2.getDirection(),
7474
OCIO.TRANSFORM_DIR_FORWARD)
7575

7676
def test_constructor_positional(self):
7777
# Positional args
78-
builtin_tr = OCIO.BuiltinTransform(self.EXAMPLE_STYLE,
78+
builtin_tr = OCIO.BuiltinTransform(self.EXAMPLE_STYLE,
7979
OCIO.TRANSFORM_DIR_FORWARD)
8080

8181
self.assertEqual(builtin_tr.getStyle(), self.EXAMPLE_STYLE)
8282
self.assertEqual(builtin_tr.getDescription(), self.EXAMPLE_DESC)
83-
self.assertEqual(builtin_tr.getDirection(),
83+
self.assertEqual(builtin_tr.getDirection(),
8484
OCIO.TRANSFORM_DIR_FORWARD)
8585

8686
def test_str(self):

tests/python/BuiltinTransformRegistryTest.py renamed to tests/python/test_BuiltinTransformRegistry.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from UnitTestUtils import STRING_TYPES
1414

1515

16-
class BuiltinTransformRegistryTest(unittest.TestCase):
16+
class TestBuiltinTransformRegistry(unittest.TestCase):
1717
# BuiltinTransformRegistry singleton
1818
REGISTRY = None
1919

@@ -39,7 +39,7 @@ def test_iterable(self):
3939

4040
# Iterator size is available
4141
self.assertEqual(len(iterator), len(self.REGISTRY))
42-
42+
4343
# Iterator supports range-based loop and indexing
4444
values = list(iterator)
4545
for i in range(len(iterator)):
@@ -68,7 +68,7 @@ def test_get_builtins(self):
6868

6969
# Iterator size is available
7070
self.assertEqual(len(iterator), len(self.REGISTRY))
71-
71+
7272
# Iterator supports range-based loop and indexing
7373
values = list(iterator)
7474
for i in range(len(iterator)):
@@ -91,13 +91,13 @@ def test_contains(self):
9191
self.assertFalse("invalid" in self.REGISTRY)
9292

9393
def test_multi_reference(self):
94-
# Registry is a singleton. Make sure multiple Python
94+
# Registry is a singleton. Make sure multiple Python
9595
# instances can be held.
9696
instances = []
9797
for i in range(10):
9898
instances.append(OCIO.BuiltinTransformRegistry())
9999

100-
# Other instances should still function after deleting one. The
100+
# Other instances should still function after deleting one. The
101101
# underlying C++ object is not deleted.
102102
instance_0 = instances.pop(0)
103103
self.assertEqual(len(instances), 9)
@@ -107,7 +107,7 @@ def test_multi_reference(self):
107107
with self.assertRaises(NameError):
108108
len(instance_0)
109109

110-
# Test underlying C++ reference validity by accessing registry
110+
# Test underlying C++ reference validity by accessing registry
111111
# data for each instance.
112112
for instance in instances:
113113
self.assertGreaterEqual(len(instance), 1)

tests/python/CDLTransformTest.py renamed to tests/python/test_CDLTransform.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
import PyOpenColorIO as OCIO
88
from UnitTestUtils import TEST_DATAFILES_DIR, TEST_NAMES, TEST_DESCS
9-
from TransformsBaseTest import TransformsBaseTest
9+
from test_TransformsBase import TransformsBaseTest
1010

1111

12-
class CDLTransformTest(unittest.TestCase, TransformsBaseTest):
12+
class TestCDLTransform(unittest.TestCase, TransformsBaseTest):
1313
# Default CDL values on initialization.
1414
DEFAULT_CDL_SLOPE = [1.0, 1.0, 1.0]
1515
DEFAULT_CDL_OFFSET = [0.0, 0.0, 0.0]

0 commit comments

Comments
 (0)