diff --git a/examples/quantum_chinese_chess/board_test.py b/examples/quantum_chinese_chess/board_test.py index f6dad82f..317c719e 100644 --- a/examples/quantum_chinese_chess/board_test.py +++ b/examples/quantum_chinese_chess/board_test.py @@ -170,16 +170,16 @@ def test_flying_general_check_classical_cases(): board = Board.from_fen() # If they are in different columns, the check fails. board.king_locations = ["d0", "e9"] - assert board.flying_general_check() == False + assert not board.flying_general_check() # If there are classical pieces between two KINGs, the check fails. board.king_locations = ["e0", "e9"] - assert board.flying_general_check() == False + assert not board.flying_general_check() # If there are no pieces between two KINGs, the check successes. board.board["e3"].reset() board.board["e6"].reset() - assert board.flying_general_check() == True + assert board.flying_general_check() def test_flying_general_check_quantum_cases(): diff --git a/examples/quantum_chinese_chess/chess_test.py b/examples/quantum_chinese_chess/chess_test.py index c3423d57..c59b08c1 100644 --- a/examples/quantum_chinese_chess/chess_test.py +++ b/examples/quantum_chinese_chess/chess_test.py @@ -386,12 +386,12 @@ def test_update_board_by_sampling(monkeypatch): game.update_board_by_sampling() assert board["a0"].type_ == Type.EMPTY assert board["a0"].color == Color.NA - assert board["a0"].is_entangled == False + assert not board["a0"].is_entangled board["a1"].is_entangled = True # Verify that the method would set a1 to classically occupied. game.update_board_by_sampling() - assert board["a1"].is_entangled == False + assert not board["a1"].is_entangled def test_undo_single_effect_per_move(monkeypatch): diff --git a/examples/quantum_chinese_chess/enums_test.py b/examples/quantum_chinese_chess/enums_test.py index 827cb28b..03bea06d 100644 --- a/examples/quantum_chinese_chess/enums_test.py +++ b/examples/quantum_chinese_chess/enums_test.py @@ -21,7 +21,7 @@ def test_type_of(): assert Type.type_of("k") == Type.KING assert Type.type_of("K") == Type.KING assert Type.type_of("ยท") == Type.EMPTY - assert Type.type_of("b") == None + assert Type.type_of("b") is None def test_symbol(): diff --git a/examples/quantum_chinese_chess/move_test.py b/examples/quantum_chinese_chess/move_test.py index 8a798991..af5c882b 100644 --- a/examples/quantum_chinese_chess/move_test.py +++ b/examples/quantum_chinese_chess/move_test.py @@ -80,7 +80,7 @@ def test_move_type(): move_type=MoveType.MERGE_JUMP, move_variant=MoveVariant.CAPTURE, ) - assert move1.is_split_move() == False + assert not move1.is_split_move() assert move1.is_merge_move() move2 = Move( @@ -91,7 +91,7 @@ def test_move_type(): move_variant=MoveVariant.BASIC, ) assert move2.is_split_move() - assert move2.is_merge_move() == False + assert not move2.is_merge_move() move3 = Move( world["a1"], @@ -99,8 +99,8 @@ def test_move_type(): move_type=MoveType.SLIDE, move_variant=MoveVariant.CAPTURE, ) - assert move3.is_split_move() == False - assert move3.is_merge_move() == False + assert not move3.is_split_move() + assert not move3.is_merge_move() def test_to_str(): @@ -275,10 +275,10 @@ def test_split_jump_classical_source(): assert_fifty_fifty(board_probabilities, locations_to_bitboard(["a3"])) assert world["a2"].type_ == Type.ROOK assert world["a2"].color == Color.RED - assert world["a2"].is_entangled == True + assert world["a2"].is_entangled assert world["a3"].type_ == Type.ROOK assert world["a3"].color == Color.RED - assert world["a3"].is_entangled == True + assert world["a3"].is_entangled def test_split_jump_quantum_source(): @@ -295,8 +295,8 @@ def test_split_jump_quantum_source(): locations_to_bitboard(["a5"]): 0.25, }, ) - assert world["a4"].is_entangled == True - assert world["a5"].is_entangled == True + assert world["a4"].is_entangled + assert world["a5"].is_entangled def test_merge_jump_perfect_merge(): diff --git a/examples/quantum_chinese_chess/piece_test.py b/examples/quantum_chinese_chess/piece_test.py index 90caf3dc..5be46ee5 100644 --- a/examples/quantum_chinese_chess/piece_test.py +++ b/examples/quantum_chinese_chess/piece_test.py @@ -58,7 +58,7 @@ def test_reset(): p0.reset() assert p0.type_ == Type.EMPTY assert p0.color == Color.NA - assert p0.is_entangled == False + assert not p0.is_entangled p0.reset(p1) assert p0.type_ == p1.type_ diff --git a/unitary/alpha/quantum_world_test.py b/unitary/alpha/quantum_world_test.py index fc40d128..bab88672 100644 --- a/unitary/alpha/quantum_world_test.py +++ b/unitary/alpha/quantum_world_test.py @@ -51,7 +51,7 @@ def test_get_object_by_name(compile_to_qubits): board = alpha.QuantumWorld([light, light2], compile_to_qubits=compile_to_qubits) assert board.get_object_by_name("test") == light assert board.get_object_by_name("test2") == light2 - assert board.get_object_by_name("test3") == None + assert board.get_object_by_name("test3") is None assert board["test"] == light assert board["test2"] == light2 with pytest.raises(KeyError):