Skip to content

Commit 0029de7

Browse files
committed
D. J.:
- Changed tests where expected is a boolean value
1 parent 7f8b56c commit 0029de7

17 files changed

+17
-17
lines changed

tests/test_100_same_tree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ def test_func(p: List[int], q: List[int], expected: bool):
1818
p = TreeNode.build(p)
1919
q = TreeNode.build(q)
2020
is_same_tree = Solution().isSameTree(p, q)
21-
assert is_same_tree == expected
21+
assert is_same_tree is expected

tests/test_101_symmetric_tree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ def test_func(root: List[int], expected: bool):
1616
"""Tests the solution of a LeetCode problem."""
1717
root = TreeNode.build(root)
1818
is_symmetric = Solution().isSymmetric(root)
19-
assert is_symmetric == expected
19+
assert is_symmetric is expected

tests/test_112_path_sum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ def test_func(root: List[int], targetSum: int, expected: bool):
1717
"""Tests the solution of a LeetCode problem."""
1818
root = TreeNode.build(root)
1919
has_path_sum = Solution().hasPathSum(root, targetSum)
20-
assert has_path_sum == expected
20+
assert has_path_sum is expected

tests/test_125_valid_palindrome.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
def test_func(s: str, expected: bool):
1515
"""Tests the solution of a LeetCode problem."""
1616
max_profit = Solution().isPalindrome(s)
17-
assert max_profit == expected
17+
assert max_profit is expected

tests/test_141_linked_list_cycle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ def test_func(head: List[int], pos: int, expected: bool):
1717
"""Tests the solution of a LeetCode problem."""
1818
head = ListNode.build(head, pos)
1919
has_cycle = Solution().hasCycle(head)
20-
assert has_cycle == expected
20+
assert has_cycle is expected

tests/test_202_happy_number.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
def test_func(n: int, expected: bool):
1414
"""Tests the solution of a LeetCode problem."""
1515
is_happy = Solution().isHappy(n)
16-
assert is_happy == expected
16+
assert is_happy is expected

tests/test_205_isomorphic_strings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
def test_func(s: str, t: str, expected: bool):
1111
"""Tests the solution of a LeetCode problem."""
1212
is_isomorphic = Solution().isIsomorphic(s, t)
13-
assert is_isomorphic == expected
13+
assert is_isomorphic is expected

tests/test_207_course_schedule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
def test_func(numCourses: int, prerequisites: List[List[int]], expected: bool):
1616
"""Tests the solution of a LeetCode problem."""
1717
can_finish = Solution().canFinish(numCourses, prerequisites)
18-
assert can_finish == expected
18+
assert can_finish is expected

tests/test_20_valid_parentheses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
def test_func(s: str, expected: bool):
1616
"""Tests the solution of a LeetCode problem."""
1717
is_valid = Solution().isValid(s)
18-
assert is_valid == expected
18+
assert is_valid is expected

tests/test_210_course_schedule_II.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
(1, [], [0]),
1414
],
1515
)
16-
def test_func(numCourses: int, prerequisites: List[List[int]], expected: bool):
16+
def test_func(numCourses: int, prerequisites: List[List[int]], expected: List[int]):
1717
"""Tests the solution of a LeetCode problem."""
1818
order = Solution().findOrder(numCourses, prerequisites)
1919
assert order == expected

0 commit comments

Comments
 (0)