Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI

on:
push:
pull_request:
workflow_dispatch:
# manually triggered

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[testing]"
- name: Test with pytest
run: pytest
5 changes: 1 addition & 4 deletions flask_loopback/flask_loopback.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class FlaskLoopback(object):
def __init__(self, flask_app):
super(FlaskLoopback, self).__init__()
self.flask_app = flask_app
self._test_client = flask_app.test_client()
self._test_client = flask_app.test_client(use_cookies=False)
self._request_context_handlers = []
self._registered_addresses = set()
self._use_ssl = {}
Expand Down Expand Up @@ -101,9 +101,6 @@ def handle_request(self, session, url, request):
except CustomHTTPResponse as e:
return e.response

self._test_client.cookie_jar.clear()
for cookie in request._cookies: # pylint: disable=protected-access
self._test_client.cookie_jar.set_cookie(cookie)
resp = self._test_client.open(path, **open_kwargs)
returned = requests.Response()
assert returned.url is None
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
requests
Flask
six
Comment thread
vmalloc marked this conversation as resolved.
URLObject
werkzeug>=1.0.0

unittest2; python_version<'2.7'
contextlib2; python_version<'3.3'
8 changes: 4 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[metadata]
name = Flask-Loopback
classifiers =
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
summary = Library for faking HTTP requests using flask applications without actual network operations
description-file =
README.md
Expand Down