Skip to content

Commit

Permalink
Merge pull request #1057 from RasaHQ/ATO-887-upgrade-sanic-and-sanic-…
Browse files Browse the repository at this point in the history
…testing

[ATO-887] Upgrade Sanic and Sanic-testing
  • Loading branch information
Tawakalt authored Jan 8, 2024
2 parents c1fec2a + d724d99 commit 0907d17
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 24 deletions.
1 change: 1 addition & 0 deletions changelog/1057.improvement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Upgrade `sanic` and `sanic-testing`.
35 changes: 18 additions & 17 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ select = [ "D", "E", "F", "W", "RUF",]
[tool.poetry.dependencies]
python = ">=3.8,<3.11"
coloredlogs = ">=10,<16"
sanic = "^21.12.0"
sanic = "^22.12"
typing-extensions = ">=4.1.1,<5.0.0"
Sanic-Cors = "^2.0.0"
prompt-toolkit = "^3.0,<3.0.29"
Expand All @@ -99,7 +99,7 @@ toml = "^0.10.0"
pep440-version-utils = "^0.3.0"
semantic_version = "^2.8.5"
mypy = "^1.5"
sanic-testing = "^22.3.0, <22.9.0"
sanic-testing = "^22.12"

[tool.ruff.pydocstyle]
convention = "google"
Expand Down
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 0907d17

Please sign in to comment.