Pytest-httpserver

Latest version: v1.1.0

Safety actively analyzes 682471 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 5

1.0.1

Not secure
=====

.. _Release Notes_1.0.1_New Features:

New Features
------------

- Improved error handling of custom request handlers. Request handlers added
with ``respond_with_handler`` now can use the ``assert`` statement. Those
errors will be reported when a further ``check_assertions()`` call is made.
Also, unhandled exceptions raised in the request handlers can be re-raised
by calling the new ``check_handler_errors()`` method. A new method called
``check()`` has been added which calls these two in sequence.


.. _Release Notes_1.0.0:

1.0.0

Not secure
=====

.. _Release Notes_1.0.0_Prelude:

Prelude
-------

Functionally the same as 1.0.0rc1. For the list of changes between 0.3.8 and 1.0.0 see the changelist for 1.0.0rc1.


.. _Release Notes_1.0.0rc1:

1.0.0rc1

Not secure
========

.. _Release Notes_1.0.0rc1_New Features:

New Features
------------

- Added a new session scoped fixture ``make_httpserver`` which creates the
object for the ``httpserver`` fixture. It can be overridden to add further
customizations and it must yield a ``HTTPServer`` object - see
``pytest_plugin.py`` for an implementation. As this fixture is session
scoped, it will be called only once when the first test using httpserver is
started. This addition also deprecates the use of ``PluginHTTPServer`` which was
used in earlier versions as a way to customize server object creation.
``PluginHTTPServer`` can still be used but it may be subject to deprecation
in the future.

- Added a new session scoped fixture ``httpserver_ssl_context`` which provides
the SSL context for the server. By default it returns ``None``, so SSL is
not enabled, but can be overridden to return a valid ``ssl.SSLContext``
object which will be used for SSL connections. See test_ssl.py for example.


.. _Release Notes_1.0.0rc1_Upgrade Notes:

Upgrade Notes
-------------

- **Breaking change**: The scope of ``httpserver_listen_address`` fixture changed from **function**
to **session**. This is a requirement to implement the other features listed
in this release. See the `upgrade guide
<https://pytest-httpserver.readthedocs.io/en/latest/upgrade.html>`_ for the
details.


.. _Release Notes_0.3.8:

0.3.8

Not secure
=====

.. _Release Notes_0.3.8_Deprecation Notes:

Deprecation Notes
-----------------

- Deprecation warnings were added to prepare changes to 1.0.0. More details:
https://pytest-httpserver.readthedocs.io/en/latest/upgrade.html


.. _Release Notes_0.3.7:

0.3.7

Not secure
=====

.. _Release Notes_0.3.7_Other Notes:

Other Notes
-----------

- Removed pytest-runner from setup.py as it is deprecated and makes packaging inconvenient
as it needs to be installed before running setup.py.


.. _Release Notes_0.3.6:

0.3.6

Not secure
=====

.. _Release Notes_0.3.6_New Features:

New Features
------------

- HTTP methods are case insensitive. The HTTP method specified is converted to
uppercase in the library.

- It is now possible to specify a JSON-serializable python value (such as
dict, list, etc) and match the request to it as JSON. The request's body
is loaded as JSON and it will be compared to the expected value.

- The http response code sent when no handler is found for the
request can be changed. It is set to 500 by default.


.. _Release Notes_0.3.5:

Page 3 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.