Skip to content

Commit 682188b

Browse files
jorenhamcharris
authored andcommitted
STY: rename @classmethod arg to cls
1 parent 4b97a04 commit 682188b

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

numpy/_core/tests/test_stringdtype.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,17 +1631,17 @@ class TestImplementation:
16311631
"""
16321632

16331633
@classmethod
1634-
def setup_class(self):
1635-
self.MISSING = 0x80
1636-
self.INITIALIZED = 0x40
1637-
self.OUTSIDE_ARENA = 0x20
1638-
self.LONG = 0x10
1639-
self.dtype = StringDType(na_object=np.nan)
1640-
self.sizeofstr = self.dtype.itemsize
1641-
sp = self.dtype.itemsize // 2 # pointer size = sizeof(size_t)
1634+
def setup_class(cls):
1635+
cls.MISSING = 0x80
1636+
cls.INITIALIZED = 0x40
1637+
cls.OUTSIDE_ARENA = 0x20
1638+
cls.LONG = 0x10
1639+
cls.dtype = StringDType(na_object=np.nan)
1640+
cls.sizeofstr = cls.dtype.itemsize
1641+
sp = cls.dtype.itemsize // 2 # pointer size = sizeof(size_t)
16421642
# Below, size is not strictly correct, since it really uses
16431643
# 7 (or 3) bytes, but good enough for the tests here.
1644-
self.view_dtype = np.dtype([
1644+
cls.view_dtype = np.dtype([
16451645
('offset', f'u{sp}'),
16461646
('size', f'u{sp // 2}'),
16471647
('xsiz', f'V{sp // 2 - 1}'),
@@ -1652,13 +1652,13 @@ def setup_class(self):
16521652
('size', f'u{sp // 2}'),
16531653
('offset', f'u{sp}'),
16541654
])
1655-
self.s_empty = ""
1656-
self.s_short = "01234"
1657-
self.s_medium = "abcdefghijklmnopqrstuvwxyz"
1658-
self.s_long = "-=+" * 100
1659-
self.a = np.array(
1660-
[self.s_empty, self.s_short, self.s_medium, self.s_long],
1661-
self.dtype)
1655+
cls.s_empty = ""
1656+
cls.s_short = "01234"
1657+
cls.s_medium = "abcdefghijklmnopqrstuvwxyz"
1658+
cls.s_long = "-=+" * 100
1659+
cls.a = np.array(
1660+
[cls.s_empty, cls.s_short, cls.s_medium, cls.s_long],
1661+
cls.dtype)
16621662

16631663
def get_view(self, a):
16641664
# Cannot view a StringDType as anything else directly, since

0 commit comments

Comments
 (0)