Skip to content

Commit

Permalink
Add test for Flask 1.x and 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
greyli committed Oct 22, 2023
1 parent 9fd814c commit 900a4f5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
name: tests
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest, macos-latest] # TODO: add windows-latest
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand Down
7 changes: 6 additions & 1 deletion src/flask_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
import logging
from os import path

from flask.globals import request_ctx, app_ctx
try:
from flask.globals import request_ctx, app_ctx
except ImportError:
from flask import _request_ctx_stack, _app_ctx_stack
request_ctx = _request_ctx_stack.top
app_ctx = _app_ctx_stack.top
from flask import current_app, has_app_context, has_request_context
from flask.templating import render_template_string
# We want to expose Bundle via this module.
Expand Down
18 changes: 17 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py37, py38, py39, py310, py311, py312
envlist = py37, py38, py39, py310, py311, py312, flask1, flask2
skip_missing_interpreters = true

[gh-actions]
Expand All @@ -10,9 +10,25 @@ python =
3.10: py310
3.11: py311
3.12: py312
flask1: py38
flask2: py310

[testenv]
deps =
-r requirements.txt
commands =
pytest

[flask1]
deps =
-r requirements.txt
flask==1.0.0
commands =
pytest

[flask2]
deps =
-r requirements.txt
flask==2.0.0
commands =
pytest

0 comments on commit 900a4f5

Please sign in to comment.