Skip to content

Commit

Permalink
fix(tests): fix platform compat tests (#2310)
Browse files Browse the repository at this point in the history
* fix platform compat tests
* fix mako template test for windows


---------

Signed-off-by: Janek Nouvertné <[email protected]>
  • Loading branch information
provinzkraut authored Sep 18, 2023
1 parent 359fa32 commit f73da61
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/docker_service_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def down(self) -> None:

@pytest.fixture(scope="session")
def docker_services(worker_id: str) -> Generator[DockerServiceRegistry, None, None]:
if os.getenv("GITHUB_ACTIONS") == "true" and sys.platform == "win32":
if os.getenv("GITHUB_ACTIONS") == "true" and sys.platform != "linux":
pytest.skip("Docker not available on this platform")

registry = DockerServiceRegistry(worker_id)
Expand Down
4 changes: 2 additions & 2 deletions tests/examples/test_contrib/test_piccolo_orm.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
pytestmark = [
pytest.mark.xdist_group("piccolo"),
pytest.mark.skipif(
sys.platform == "win32",
reason="piccolo ORM itself is not tested against windows",
sys.platform != "linux",
reason="piccolo ORM itself is not tested against windows and macOS",
),
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async def app(monkeypatch: MonkeyPatch, request: FixtureRequest) -> Litestar:
return app_module.app


@pytest.mark.skipif(sys.platform == "win32", reason="fails on Windows, in CI only")
@pytest.mark.skipif(sys.platform != "linux", reason="Unknown - fails on Windows and macOS, in CI only")
def test_no_plugins_full_app(app: Litestar) -> None:
todo = {"title": "Start writing todo list", "done": True}
todo_list = [todo]
Expand Down
2 changes: 1 addition & 1 deletion tests/examples/test_templating/test_returning_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_returning_templates_jinja():
def test_returning_templates_mako():
with TestClient(mako_app) as client:
response = client.get("/", params={"name": "Mako"})
assert response.text == "Hello <strong>Mako</strong>\n"
assert response.text.strip() == "Hello <strong>Mako</strong>"


def test_returning_templates_minijinja():
Expand Down
2 changes: 1 addition & 1 deletion tests/examples/test_templating/test_template_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_template_functions_jinja():
def test_template_functions_mako():
with TestClient(mako_app) as client:
response = client.get("/")
assert response.text == "<strong>check_context_key: </strong>nope\n"
assert response.text.strip() == "<strong>check_context_key: </strong>nope"


def test_template_functions_minijinja():
Expand Down

0 comments on commit f73da61

Please sign in to comment.