-
-
Notifications
You must be signed in to change notification settings - Fork 387
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: SQLAlchemyInitPlugin to SQLAlchemyPlugin fixes SerializationExc…
…eption for docs (#3475) * Update sqlalchemy_declarative_models.py Now uses the SQLAlchemyPlugin in stead of SQLAlchemyInitPlugin, see #3464 * Update sqlalchemy_declarative_models.py Ruff lint fixes * Update docs/examples/contrib/sqlalchemy/sqlalchemy_declarative_models.py create_all flag Co-authored-by: Cody Fincher <[email protected]> * Update docs/examples/contrib/sqlalchemy/sqlalchemy_declarative_models.py Co-authored-by: Peter Schutt <[email protected]> * Update docs/examples/contrib/sqlalchemy/sqlalchemy_declarative_models.py Further documentation Co-authored-by: Peter Schutt <[email protected]> * Update docs/examples/contrib/sqlalchemy/sqlalchemy_declarative_models.py Co-authored-by: Peter Schutt <[email protected]> * Update docs/examples/contrib/sqlalchemy/sqlalchemy_declarative_models.py Co-authored-by: Cody Fincher <[email protected]> * Unit test for sqlalchemy_declarative_models. * Now using option create_all=True for meta-data, on_startup for dummy data * Lint ruff-format compatibility * Fix for 3.9 and 3.10 wrt class declarations/typing * Ruff format check * Removed comments which might be heavy for example code * For 3.8 compatibility wrt typing now using List in stead of list * Replaced incorrect use of List instead of List --------- Co-authored-by: Cody Fincher <[email protected]> Co-authored-by: Peter Schutt <[email protected]>
- Loading branch information
1 parent
142bfe3
commit 5afa40f
Showing
3 changed files
with
36 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
tests/examples/test_contrib/test_sqlalchemy/test_sqlalchemy_examples.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import pytest | ||
|
||
from litestar.testing import TestClient | ||
|
||
pytestmark = pytest.mark.xdist_group("sqlalchemy_examples") | ||
|
||
|
||
def test_sqlalchemy_declarative_models() -> None: | ||
from docs.examples.contrib.sqlalchemy.sqlalchemy_declarative_models import app | ||
|
||
with TestClient(app) as client: | ||
response = client.get("/authors") | ||
assert response.status_code == 200 | ||
assert len(response.json()) > 0 |