File: test_markers.py

package info (click to toggle)
pytest-flask 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 280 kB
  • sloc: python: 553; makefile: 161; sh: 5
file content (22 lines) | stat: -rwxr-xr-x 558 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import pytest
from flask import Flask


@pytest.fixture(scope="session")
def app():
    app = Flask(__name__)
    app.config["SECRET_KEY"] = "42"
    return app


class TestOptionMarker:
    @pytest.mark.options(debug=False)
    def test_not_debug_app(self, app):
        assert not app.debug, "Ensure the app not in debug mode"

    @pytest.mark.options(foo=42)
    def test_update_application_config(self, request, app, config):
        assert config["FOO"] == 42

    def test_application_config_teardown(self, config):
        assert "FOO" not in config