Commit Graph

37 Commits

Author SHA1 Message Date
David Lord 1351d0a565
Merge branch '1.0.x' 2019-06-23 16:57:52 -07:00
David Lord e666f7a69c
standardize license and copyright 2019-06-22 13:09:09 -07:00
David Lord c65863912b
move url matching after opening session 2019-06-13 12:40:01 -07:00
Elad Moshe 1ff98a2d21
wait until app ctx is ready before matching url
`RequestContext.match_request` is moved from `__init__` to `push`. This
causes matching to happen later, when the app context is available.
This enables URL converters that use things such as the database.
2019-06-13 08:32:23 -07:00
David Lord 43483683b2
apply reorder-python-imports pre-commit config 2019-06-01 09:07:20 -07:00
Jon S. Stumpf b46f5942a5
address flake8 issues 2019-06-01 06:31:35 -07:00
Daniel Pope c7f56c5a55 Create json_dumps() method on new EnvironBuilder 2019-05-31 18:05:25 +01:00
Daniel Pope 976dfedaa9 Convert make_test_environ_builder into class (fixes #3207) 2019-05-31 18:05:25 +01:00
Fantix King a71c167836
fix teardown bug in FlaskClient
* Fixes pytest-dev/pytest-flask#42
2019-05-25 14:03:28 -07:00
David Lord 05a4e15ee4
Merge branch '1.0.x' 2019-05-17 11:13:08 -07:00
David Lord a4f0f19796
don't push app context for test client json 2019-05-17 09:00:08 -07:00
David Baumgold 025589ee76 Reformat with black
https://github.com/python/black
2019-05-06 16:28:58 -04:00
Armin Ronacher 8cec2010c0
Do not enable subdomain matching by default
Updated tests for new subdomain matching
Added a test to validate matching behavior
2018-02-23 07:53:27 -08:00
David Lord cf5525f98a
add test_cli_runner for testing app.cli commands 2018-02-19 15:34:46 -08:00
David Lord 310fbfcf64
revert copyright year to project start
add copyright header to files
2018-02-08 12:43:30 -08:00
David Lord 66b1b752da
simplify logging configuration
single default handler and formatter
don't remove handlers
configure level once using setLevel
document logging
reorganize logging tests
2017-07-31 12:49:03 -07:00
David Lord a89bdb3395
prefer the url's scheme over the kwarg
tabs -> spaces
add test
add changelog
2017-07-29 13:03:08 -07:00
David Lord 59f7966e31 support passing environ to test client (#2412)
closes #2411
2017-07-13 08:42:53 -07:00
David Lord 465922e5f1
clean up secret key docs
consistent key across docs and examples
consistent key across tests, set in conftest
2017-06-28 07:58:06 -07:00
David Lord e97253e4c1
clean up JSON code and docs 2017-06-04 11:44:00 -07:00
David Lord dbc70c9274
Merge remote-tracking branch 'remotes/origin/master' into json-mixin 2017-06-04 09:42:39 -07:00
David Lord a37f675ccb
Merge remote-tracking branch 'origin/0.10-maintenance'
refactor make_test_environ_builder
2017-05-28 07:25:15 -07:00
Christian Stade-Schuldt 4ec1fbc9f5 More DRYing up the test suite (#2325) 2017-05-24 17:27:36 -07:00
Christian Stade-Schuldt 5b0b9717da DRYing up the test suite using pytest fixtures (#2306)
* add fixtures to conftest.py

* use fixtures in test_appctx.py

* use fixtures in test_blueprints.py

* use fixtures in test_depreciations.py

* use fixtures in test_regressions.py

* use fixtures in test_reqctx.py

* use fixtures in test_templating.py

* use fixtures in test_user_error_handler.py

* use fixtures in test_views.py

* use fixtures in test_basics.py

* use fixtures in test_helpers.py

* use fixtures in test_testing.py

* update conftest.py

* make docstrings  PEP-257 compliant

* cleanup

* switch dictonary format

* use pytest parameterization for test_json_as_unicode
2017-05-23 15:18:39 -07:00
Michael Recachinas bd5e297aa9 Default environ (#2047)
* Add init to FlaskClient

This addresses #1467. The init in the subclass
can now take in `environ_base`, which will then get
passed to `make_test_environ_builder` and to
`EnvironBuilder` via keyword args.

This should provide the default environment capability
on `app.test_client()` init.

* Add kwarg `environ_base` to `make_test_environ_builder` call

This change now passes `environ_base` from either
`kwargs` in `FlaskClient.open` or `FlaskClient.environ_base`
if passed into the init.

* Fix assignment reference typo

* Add default `environ_base` to `FlaskClient.__init__`

* Set default kwargs for `environ_base` in `FlaskClient.open`

* Remove specific environ_base kwarg since its in kwargs

* Add docstring to FlaskClient detailing environ_base

* Document app.test_client default environ in CHANGES

* Re-word environ_base changes in FlaskClient docstring

* Add client.environ_base tests

* Mention preset default environ in `app.test_client`

* Add versionchanged directive to docstring in FlaskClient
2016-10-12 08:54:24 +02:00
Adam Byrtek ca547f0ec3 JSON response tests and first draft of code that passes 2016-08-19 21:14:12 +02:00
Adam Byrtek 6c5ef2bc5c Use `content_type` kwarg instead of manipulating headers 2016-08-19 21:13:33 +02:00
Adam Byrtek c4139e0e5d JSON support for the Flask test client 2016-08-19 21:13:33 +02:00
Reuven 4dc2ef19ea Use pytest.raises() instead of try/catch with asser 0
This is somehow more readable, and enable using the features of pytest's ExeptionInfo (such as errisinstance).
2016-03-04 13:30:40 +02:00
Parkayun 33534bb4a9 Happy New Year 2015 2015-01-02 11:35:00 +09:00
Markus Unterwaditzer c6795eb626 Remove useless unittest imports 2014-09-21 16:47:38 +02:00
Markus Unterwaditzer f8a778deae Kill classes in test_testing 2014-09-11 22:09:52 +02:00
Markus Unterwaditzer af4cb0ff2b Remove flask superclass 2014-09-11 22:09:51 +02:00
Markus Unterwaditzer af41dbe0c4 Remove useless classes 2014-09-11 22:09:51 +02:00
Markus Unterwaditzer 5da2c00419 Rewrite assertion methods 2014-09-11 22:09:51 +02:00
Markus Unterwaditzer 8fa5e32d9a Tests pass now. 2014-09-11 22:09:50 +02:00
Markus Unterwaditzer 961db8ad72 Made tests recognizable 2014-09-11 22:09:50 +02:00