@pytest.fixture(autouse=True)
def _monkeypatch_response_class(request, monkeypatch):
    """Set custom response class before test suite and restore the original
    after. Custom response has `json` property to easily test JSON responses::

        @app.route('/ping')
        def ping():
            return jsonify(ping='pong')

        def test_json(client):
            res = client.get(url_for('ping'))
            assert res.json == {'ping': 'pong'}

    """
    if request.fixturenames not in 'app':
        return

    app = request.getfuncargvalue('app')
    monkeypatch.setattr(app, 'response_class',
                        _make_test_response_class(app.response_class))
dataset/ETHPy150Open vitalk/pytest-flask/pytest_flask/plugin.py/_monkeypatch_response_class/swapped operands of `not in`