(tmpdir)
| 25 | ), |
| 26 | ) |
| 27 | def test_gevent_monkeypatch(tmpdir): |
| 28 | # type: (Any) -> None |
| 29 | |
| 30 | with safe_open(os.path.join(str(tmpdir), "app.py"), "w") as app_fp: |
| 31 | app_fp.write( |
| 32 | dedent( |
| 33 | """\ |
| 34 | from flask import Flask |
| 35 | |
| 36 | |
| 37 | app = Flask(__name__) |
| 38 | |
| 39 | |
| 40 | @app.route("/<username>") |
| 41 | def hello_world(username): |
| 42 | return "Hello, {}!".format(username) |
| 43 | """ |
| 44 | ) |
| 45 | ) |
| 46 | |
| 47 | pex_root = os.path.join(str(tmpdir), "pex_root") |
| 48 | pex = os.path.join(str(tmpdir), "pex") |
| 49 | |
| 50 | # N.B.: Created with the following, where gevent 1.3.4 was picked as a lower bound since it |
| 51 | # 1st introduced the `from gevent import monkey; monkey.patch_all()` ssl check warning that is |
| 52 | # the subject of issue 2415: |
| 53 | # |
| 54 | # pex3 lock create \ |
| 55 | # --resolver-version pip-2020-resolver \ |
| 56 | # --pip-version latest \ |
| 57 | # --style universal \ |
| 58 | # --interpreter-constraint ">=3.8,<3.13" \ |
| 59 | # --no-build \ |
| 60 | # --indent 2 \ |
| 61 | # flask \ |
| 62 | # "gevent>=1.3.4" \ |
| 63 | # gunicorn[gevent] |
| 64 | lock = data.path("locks", "issue-2415.lock.json") |
| 65 | |
| 66 | run_pex_command( |
| 67 | args=[ |
| 68 | "--pex-root", |
| 69 | pex_root, |
| 70 | "--runtime-pex-root", |
| 71 | pex_root, |
| 72 | "--lock", |
| 73 | lock, |
| 74 | "-M", |
| 75 | "app", |
| 76 | "-c", |
| 77 | "gunicorn", |
| 78 | "--inject-args", |
| 79 | "--worker-class gevent app:app", |
| 80 | "-o", |
| 81 | pex, |
| 82 | ], |
| 83 | cwd=str(tmpdir), |
| 84 | ).assert_success() |
nothing calls this directly
no test coverage detected