Skip to content

Commit

Permalink
reorder tests to maneuver the sys.exit issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Tawakalt committed Jan 8, 2024
1 parent 4b180c3 commit 62fc1f5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/test_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
logger = logging.getLogger(__name__)


def test_endpoint_exit_for_unknown_actions_package():
with pytest.raises(SystemExit):
ep.create_app("non-existing-actions-package")


def test_server_health_returns_200():
request, response = app.test_client.get("/health")
assert response.status == 200
Expand Down Expand Up @@ -110,3 +105,10 @@ def test_server_webhook_custom_action_encoded_data_returns_200():

assert events == [SlotSet("test", "bar")]
assert response.status == 200


# ENSURE THIS IS ALWAYS THE LAST TEST FOR OTHER TESTS TO RUN
# because the call to sys.exit() terminates pytest process
def test_endpoint_exit_for_unknown_actions_package():
with pytest.raises(SystemExit):
ep.create_app("non-existing-actions-package")

0 comments on commit 62fc1f5

Please sign in to comment.