diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3552636..522be63 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,4 +40,4 @@ jobs: source venv/bin/activate pip install -r requirements.txt - run: echo "$PWD/venv/bin" >> $GITHUB_PATH - - run: timeout 5 otree devserver & otree test bargaining_test + - run: timeout 5 otree devserver & otree test bargaining_test 2> stderr.log || cat stderr.log; rm stderr.log diff --git a/live_bargaining/tests.py b/live_bargaining/tests.py index 358d807..49c7057 100644 --- a/live_bargaining/tests.py +++ b/live_bargaining/tests.py @@ -154,42 +154,42 @@ def test_invalid_input(method): def call_live_method(method, **kwargs): - # Invalid input + print(f"Round {kwargs['round_number']}: ", end="") + if kwargs["round_number"] == 1: + print("Testing invalid input") test_invalid_input(method) - # Grand coalition if kwargs["round_number"] == 2: + print("Testing grand coalition") create_offers(method) method(3, {"type": "accept", "offer_id": 1}) method(1, {"type": "accept", "offer_id": 2}) method(2, {"type": "accept", "offer_id": 2}) method(3, {"type": "accept", "offer_id": 2}) - # No agreement if kwargs["round_number"] == 3: + print("Testing no agreement") create_offers(method) method(1, {"type": "accept", "offer_id": 2}) method(2, {"type": "accept", "offer_id": 2}) method(3, {"type": "accept", "offer_id": 1}) - # Smaller coalition if kwargs["round_number"] == 4: + print("Testing smaller coalition") create_offers(method) method(1, {"type": "accept", "offer_id": 3}) method(2, {"type": "accept", "offer_id": 3}) method(3, {"type": "accept", "offer_id": 1}) - # Revoke acceptance if kwargs["round_number"] == 5: + print("Testing revoking acceptance") create_offers(method) method(1, {"type": "accept", "offer_id": 1}) method(2, {"type": "accept", "offer_id": 1}) method(3, {"type": "accept", "offer_id": 1}) method(2, {"type": "accept", "offer_id": 0}) - print("Payoffs: ") - class PlayerBot(Bot): def play_round(self): @@ -219,4 +219,6 @@ def play_round(self): if self.round_number == 5: expect(self.player.payoff, c(0)) + print(f"Player {self.player.id_in_group} received payoff: {self.player.payoff}") + yield BargainingResults