From d49233662a98302d7bd1c3fd6a394d25caeeed64 Mon Sep 17 00:00:00 2001 From: Jason Antman Date: Wed, 12 Jun 2024 19:34:44 -0400 Subject: [PATCH] Flask and pytest-blockage --- noxfile.py | 12 ++++++-- poetry.lock | 77 +++++++++++++++++++++++++++++++++++++++++++++++++- pyproject.toml | 4 +++ 3 files changed, 90 insertions(+), 3 deletions(-) diff --git a/noxfile.py b/noxfile.py index eee201c..9b940db 100644 --- a/noxfile.py +++ b/noxfile.py @@ -161,9 +161,17 @@ def mypy(session: Session) -> None: def tests(session: Session) -> None: """Run the test suite.""" session.install(".") - session.install("coverage[toml]", "pytest", "pygments") + session.install("coverage[toml]", "pytest", "pygments", "pytest-blockage") try: - session.run("coverage", "run", "--parallel", "-m", "pytest", *session.posargs) + session.run( + "coverage", + "run", + "--parallel", + "-m", + "pytest", + "--blockage", + *session.posargs, + ) finally: if session.interactive: session.notify("coverage", posargs=[]) diff --git a/poetry.lock b/poetry.lock index 0b40c48..0a50192 100644 --- a/poetry.lock +++ b/poetry.lock @@ -172,6 +172,17 @@ d = ["aiohttp (>=3.7.4)", "aiohttp (>=3.7.4,!=3.9.0)"] jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] uvloop = ["uvloop (>=0.15.2)"] +[[package]] +name = "blinker" +version = "1.8.2" +description = "Fast, simple object-to-object and broadcast signaling" +optional = false +python-versions = ">=3.8" +files = [ + {file = "blinker-1.8.2-py3-none-any.whl", hash = "sha256:1779309f71bf239144b9399d06ae925637cf6634cf6bd131104184531bf67c01"}, + {file = "blinker-1.8.2.tar.gz", hash = "sha256:8f77b09d3bf7c795e969e9486f39c2c5e9c39d4ee07424be2bc594ece9642d83"}, +] + [[package]] name = "certifi" version = "2024.6.2" @@ -669,6 +680,28 @@ restructuredtext-lint = "*" [package.extras] develop = ["build", "twine"] +[[package]] +name = "flask" +version = "3.0.3" +description = "A simple framework for building complex web applications." +optional = false +python-versions = ">=3.8" +files = [ + {file = "flask-3.0.3-py3-none-any.whl", hash = "sha256:34e815dfaa43340d1d15a5c3a02b8476004037eb4840b34910c6e21679d288f3"}, + {file = "flask-3.0.3.tar.gz", hash = "sha256:ceb27b0af3823ea2737928a4d99d125a06175b8512c445cbd9a9ce200ef76842"}, +] + +[package.dependencies] +blinker = ">=1.6.2" +click = ">=8.1.3" +itsdangerous = ">=2.1.2" +Jinja2 = ">=3.1.2" +Werkzeug = ">=3.0.0" + +[package.extras] +async = ["asgiref (>=3.2)"] +dotenv = ["python-dotenv"] + [[package]] name = "furo" version = "2024.5.6" @@ -747,6 +780,17 @@ files = [ [package.extras] colors = ["colorama (>=0.4.6)"] +[[package]] +name = "itsdangerous" +version = "2.2.0" +description = "Safely pass data to untrusted environments and back." +optional = false +python-versions = ">=3.8" +files = [ + {file = "itsdangerous-2.2.0-py3-none-any.whl", hash = "sha256:c6242fc49e35958c8b15141343aa660db5fc54d4f13a1db01a3f5891b98700ef"}, + {file = "itsdangerous-2.2.0.tar.gz", hash = "sha256:e0050c0b7da1eea53ffaf149c0cfbb5c6e2e2b69c4bef22c81fa6eb73e5f6173"}, +] + [[package]] name = "jinja2" version = "3.1.4" @@ -1307,6 +1351,20 @@ pluggy = ">=1.5,<2.0" [package.extras] dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] +[[package]] +name = "pytest-blockage" +version = "0.2.4" +description = "Disable network requests during a test run." +optional = false +python-versions = "*" +files = [ + {file = "pytest-blockage-0.2.4.tar.gz", hash = "sha256:7127b9251242dfce7acce3f9f619727d06d22368249289c9cd7396134133c9a8"}, + {file = "pytest_blockage-0.2.4-py3-none-any.whl", hash = "sha256:b853f2259a290f079918cb886fb5f3e3fdd9e5e677d6aee60a580012daf9bf91"}, +] + +[package.dependencies] +pytest = "*" + [[package]] name = "pyupgrade" version = "3.16.0" @@ -1873,7 +1931,24 @@ platformdirs = ">=3.9.1,<5" docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2,!=7.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8)", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10)"] +[[package]] +name = "werkzeug" +version = "3.0.3" +description = "The comprehensive WSGI web application library." +optional = false +python-versions = ">=3.8" +files = [ + {file = "werkzeug-3.0.3-py3-none-any.whl", hash = "sha256:fc9645dc43e03e4d630d23143a04a7f947a9a3b5727cd535fdfe155a17cc48c8"}, + {file = "werkzeug-3.0.3.tar.gz", hash = "sha256:097e5bfda9f0aba8da6b8545146def481d06aa7d3266e7448e2cccf67dd8bd18"}, +] + +[package.dependencies] +MarkupSafe = ">=2.1.1" + +[package.extras] +watchdog = ["watchdog (>=2.3)"] + [metadata] lock-version = "2.0" python-versions = "^3.12" -content-hash = "905ccdb10e924d6a479d83181b5433ffb489a8a0932a18495af78a8b305c5268" +content-hash = "bef036c9100874b0d1ead750110e02999a07858366243aa1cb59a49cca467e31" diff --git a/pyproject.toml b/pyproject.toml index 8cda6ca..b44a950 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,6 +20,7 @@ Changelog = "https://github.com/jantman/machine_access_control/releases" [tool.poetry.dependencies] python = "^3.12" +flask = "^3.0.3" [tool.poetry.dev-dependencies] Pygments = ">=2.10.0" @@ -44,6 +45,9 @@ pyupgrade = ">=2.29.1" safety = ">=1.10.3" typeguard = ">=2.13.3" +[tool.poetry.group.dev.dependencies] +pytest-blockage = "^0.2.4" + [tool.coverage.paths] source = ["src", "*/site-packages"] tests = ["tests", "*/tests"]