Skip to content

Commit 049147f

Browse files
committed
refactor(python): changed the variable type of expected in the test case from str to any
1 parent 7648476 commit 049147f

6 files changed

Lines changed: 16 additions & 16 deletions

File tree

programmers/2025_프로그래머스_코드챌린지_1차_예선/python/지게차와_크레인/sample.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"A"
1414
]
1515
],
16-
"expected": "11"
16+
"expected": 11
1717
},
1818
{
1919
"params": [
@@ -33,7 +33,7 @@
3333
"H"
3434
]
3535
],
36-
"expected": "4"
36+
"expected": 4
3737
},
3838
{
3939
"params": [
@@ -56,6 +56,6 @@
5656
"F"
5757
]
5858
],
59-
"expected": "16"
59+
"expected": 16
6060
}
6161
]

programmers/2025_프로그래머스_코드챌린지_1차_예선/python/지게차와_크레인/test_main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ def load_sample(filename: str):
1616

1717
class TestCase(unittest.TestCase):
1818
@parameterized.expand(load_sample("sample.json"))
19-
def test_case(self, params: list, expected: str):
19+
def test_case(self, params: list, expected: any):
2020
# When
2121
result = solution(*params)
2222

2323
# Then
24-
self.assertEqual(expected, str(result))
24+
self.assertEqual(expected, result)
2525

2626

2727
if __name__ == "__main__":

programmers/PCCP_기출문제/python/충돌위험_찾기/sample.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
[2, 4]
1414
]
1515
],
16-
"expected": "1"
16+
"expected": 1
1717
},
1818
{
1919
"params": [
@@ -30,7 +30,7 @@
3030
[4, 3]
3131
]
3232
],
33-
"expected": "9"
33+
"expected": 9
3434
},
3535
{
3636
"params": [
@@ -46,6 +46,6 @@
4646
[1, 3, 4, 5]
4747
]
4848
],
49-
"expected": "0"
49+
"expected": 0
5050
}
5151
]

programmers/PCCP_기출문제/python/충돌위험_찾기/test_main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ def load_sample(filename: str):
1616

1717
class TestCase(unittest.TestCase):
1818
@parameterized.expand(load_sample("sample.json"))
19-
def test_case(self, params: list, expected: str):
19+
def test_case(self, params: list, expected: any):
2020
# When
2121
result = solution(*params)
2222

2323
# Then
24-
self.assertEqual(expected, str(result))
24+
self.assertEqual(expected, result)
2525

2626

2727
if __name__ == "__main__":

programmers/PCCP_기출문제/python/퍼즐_게임_챌린지/sample.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
],
1414
30
1515
],
16-
"expected": "3"
16+
"expected": 3
1717
},
1818
{
1919
"params": [
@@ -31,7 +31,7 @@
3131
],
3232
59
3333
],
34-
"expected": "2"
34+
"expected": 2
3535
},
3636
{
3737
"params": [
@@ -51,7 +51,7 @@
5151
],
5252
1723
5353
],
54-
"expected": "294"
54+
"expected": 294
5555
},
5656
{
5757
"params": [
@@ -69,6 +69,6 @@
6969
],
7070
3456789012
7171
],
72-
"expected": "39354"
72+
"expected": 39354
7373
}
7474
]

programmers/PCCP_기출문제/python/퍼즐_게임_챌린지/test_main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ def load_sample(filename: str):
1616

1717
class TestCase(unittest.TestCase):
1818
@parameterized.expand(load_sample("sample.json"))
19-
def test_case(self, params: list, expected: str):
19+
def test_case(self, params: list, expected: any):
2020
# When
2121
result = solution(*params)
2222

2323
# Then
24-
self.assertEqual(expected, str(result))
24+
self.assertEqual(expected, result)
2525

2626

2727
if __name__ == "__main__":

0 commit comments

Comments
 (0)