Skip to content

Commit

Permalink
Mongo test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Lxstr committed Feb 12, 2024
1 parent 08179e7 commit 9dd505e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
31 changes: 18 additions & 13 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
name: Run unittests
on: [push, pull_request]
jobs:
unittests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: supercharge/redis-github-action@1.5.0
- uses: niden/actions-memcached@v7
- uses: actions/setup-python@v4
with:
python-version: 'pypy3.9'
- name: Install testing requirements
run: pip3 install -r requirements/pytest.txt
- name: Run tests
run: pytest tests
unittests:
runs-on: ubuntu-latest
services:
mongodb:
image: mongo
ports:
- 27017:27017
steps:
- uses: actions/checkout@v3
- uses: supercharge/redis-github-action@1.5.0
- uses: niden/actions-memcached@v7
- uses: actions/setup-python@v4
with:
python-version: "pypy3.9"
- name: Install testing requirements
run: pip3 install -r requirements/pytest.txt
- name: Run tests
run: pytest tests
7 changes: 4 additions & 3 deletions examples/hello.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
from flask import Flask, session

from flask_session import Session

app = Flask(__name__)
app.config.from_object(__name__)
app.config.update(
{
"SESSION_TYPE": "sqlalchemy",
"SQLALCHEMY_DATABASE_URI": "sqlite:////tmp/test.db",
"SQLALCHEMY_USE_SIGNER": True,
"SESSION_TYPE": "mongodb",
# "SQLALCHEMY_DATABASE_URI": "sqlite:////tmp/test.db",
# "SQLALCHEMY_USE_SIGNER": True,
}
)
Session(app)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_sqlalchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def test_use_signer(self, app_utils):
{
"SESSION_TYPE": "sqlalchemy",
"SQLALCHEMY_DATABASE_URI": "sqlite:///",
"SQLALCHEMY_USE_SIGNER": True,
"SESSION_USE_SIGNER": True,
"SECRET_KEY": "testing",
}
)

Expand Down

0 comments on commit 9dd505e

Please sign in to comment.