Skip to content

Commit c726199

Browse files
move to pytest
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
1 parent 2144aab commit c726199

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/unit/test_thrift_field_ids.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@
77

88
import inspect
99
import pytest
10-
import unittest
1110

1211
from databricks.sql.thrift_api.TCLIService import ttypes
1312

1413

15-
class TestThriftFieldIds(unittest.TestCase):
16-
"""Test suite for validating Thrift field ID constraints."""
14+
class TestThriftFieldIds:
15+
"""
16+
Unit test to validate that all Thrift-generated field IDs comply with the maximum limit.
17+
18+
Field IDs in Thrift must stay below 3329 to avoid conflicts with reserved ranges
19+
and ensure compatibility with various Thrift implementations and protocols.
20+
"""
1721

1822
MAX_ALLOWED_FIELD_ID = 3329
1923

@@ -42,7 +46,7 @@ def test_all_thrift_field_ids_are_within_allowed_range(self):
4246

4347
if violations:
4448
error_message = self._build_error_message(violations)
45-
self.fail(error_message)
49+
pytest.fail(error_message)
4650

4751
def _check_class_field_ids(self, cls, class_name, violations):
4852
"""

0 commit comments

Comments
 (0)