schemathesis 3.18.5__tar.gz → 3.19.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (313) hide show
  1. {schemathesis-3.18.5 → schemathesis-3.19.1}/.github/workflows/scheduled.yml +14 -14
  2. {schemathesis-3.18.5 → schemathesis-3.19.1}/.pre-commit-config.yaml +4 -5
  3. schemathesis-3.19.1/CITATION.cff +24 -0
  4. {schemathesis-3.18.5 → schemathesis-3.19.1}/PKG-INFO +4 -3
  5. {schemathesis-3.18.5 → schemathesis-3.19.1}/README.md +1 -0
  6. {schemathesis-3.18.5 → schemathesis-3.19.1}/docs/auth.rst +126 -9
  7. {schemathesis-3.18.5 → schemathesis-3.19.1}/docs/changelog.rst +91 -1
  8. {schemathesis-3.18.5 → schemathesis-3.19.1}/docs/cli.rst +17 -0
  9. {schemathesis-3.18.5 → schemathesis-3.19.1}/docs/python.rst +23 -0
  10. {schemathesis-3.18.5 → schemathesis-3.19.1}/example/README.rst +1 -1
  11. schemathesis-3.19.1/example/app/models.py +10 -0
  12. {schemathesis-3.18.5 → schemathesis-3.19.1}/example/requirements.in +0 -1
  13. {schemathesis-3.18.5 → schemathesis-3.19.1}/example/requirements.txt +0 -1
  14. {schemathesis-3.18.5 → schemathesis-3.19.1}/pyproject.toml +4 -4
  15. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/__init__.py +1 -3
  16. schemathesis-3.19.1/src/schemathesis/auths.py +389 -0
  17. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/cli/__init__.py +37 -20
  18. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/cli/callbacks.py +13 -1
  19. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/cli/cassettes.py +18 -18
  20. schemathesis-3.19.1/src/schemathesis/cli/context.py +46 -0
  21. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/cli/debug.py +3 -3
  22. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/cli/junitxml.py +4 -4
  23. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/cli/options.py +1 -1
  24. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/cli/output/default.py +2 -0
  25. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/constants.py +3 -3
  26. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/exceptions.py +9 -9
  27. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/extra/pytest_plugin.py +1 -1
  28. schemathesis-3.19.1/src/schemathesis/failures.py +144 -0
  29. schemathesis-3.19.1/src/schemathesis/filters.py +269 -0
  30. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/hooks.py +11 -11
  31. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/lazy.py +21 -16
  32. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/models.py +149 -107
  33. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/parameters.py +12 -7
  34. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/runner/events.py +55 -55
  35. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/runner/impl/core.py +26 -26
  36. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/runner/impl/solo.py +6 -7
  37. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/runner/impl/threadpool.py +5 -5
  38. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/runner/serialization.py +50 -50
  39. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/schemas.py +38 -23
  40. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/serializers.py +3 -3
  41. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/service/ci.py +25 -25
  42. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/service/client.py +2 -2
  43. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/service/events.py +12 -13
  44. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/service/hosts.py +4 -4
  45. schemathesis-3.19.1/src/schemathesis/service/metadata.py +41 -0
  46. schemathesis-3.19.1/src/schemathesis/service/models.py +25 -0
  47. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/service/report.py +30 -31
  48. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/service/serialization.py +2 -4
  49. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/graphql/loaders.py +21 -2
  50. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/graphql/schemas.py +8 -8
  51. schemathesis-3.19.1/src/schemathesis/specs/openapi/expressions/context.py +12 -0
  52. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/expressions/lexer.py +11 -12
  53. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/expressions/nodes.py +16 -16
  54. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/expressions/parser.py +1 -1
  55. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/links.py +15 -17
  56. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/loaders.py +29 -2
  57. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/negative/__init__.py +5 -5
  58. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/negative/mutations.py +6 -6
  59. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/parameters.py +12 -13
  60. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/references.py +2 -2
  61. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/schemas.py +11 -15
  62. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/security.py +12 -7
  63. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/stateful/links.py +4 -4
  64. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/stateful.py +19 -19
  65. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/targets.py +5 -6
  66. schemathesis-3.19.1/src/schemathesis/throttling.py +34 -0
  67. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/types.py +11 -13
  68. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/utils.py +2 -2
  69. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/auth/test_cli.py +92 -1
  70. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/auth/test_provider.py +7 -7
  71. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/auth/test_pytest.py +93 -6
  72. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/cli/test_callbacks.py +14 -0
  73. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/cli/test_commands.py +15 -7
  74. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/cli/test_options.py +1 -1
  75. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/conftest.py +3 -3
  76. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/contrib/test_unique_data.py +0 -2
  77. schemathesis-3.19.1/test/filters/test_matching.py +212 -0
  78. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/hooks/test_hooks.py +0 -6
  79. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/loaders/test_common.py +10 -4
  80. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/runner/test_runner.py +3 -3
  81. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/service/conftest.py +5 -5
  82. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/service/test_cli.py +0 -7
  83. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/service/test_report.py +2 -2
  84. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/service/test_usage.py +0 -6
  85. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/specs/graphql/test_basic.py +12 -7
  86. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/specs/openapi/conftest.py +5 -3
  87. schemathesis-3.19.1/test/specs/openapi/test_security.py +65 -0
  88. schemathesis-3.19.1/test/specs/openapi/test_validation.py +8 -0
  89. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_lazy.py +22 -0
  90. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_models.py +117 -1
  91. schemathesis-3.19.1/test/test_rate_limit.py +45 -0
  92. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_stateful.py +3 -3
  93. {schemathesis-3.18.5 → schemathesis-3.19.1}/tox.ini +1 -1
  94. schemathesis-3.18.5/example/app/models.py +0 -10
  95. schemathesis-3.18.5/src/schemathesis/auths.py +0 -214
  96. schemathesis-3.18.5/src/schemathesis/cli/context.py +0 -45
  97. schemathesis-3.18.5/src/schemathesis/failures.py +0 -145
  98. schemathesis-3.18.5/src/schemathesis/service/metadata.py +0 -42
  99. schemathesis-3.18.5/src/schemathesis/service/models.py +0 -26
  100. schemathesis-3.18.5/src/schemathesis/specs/openapi/expressions/context.py +0 -12
  101. schemathesis-3.18.5/test/specs/openapi/test_security.py +0 -15
  102. {schemathesis-3.18.5 → schemathesis-3.19.1}/.dockerignore +0 -0
  103. {schemathesis-3.18.5 → schemathesis-3.19.1}/.github/FUNDING.yml +0 -0
  104. {schemathesis-3.18.5 → schemathesis-3.19.1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  105. {schemathesis-3.18.5 → schemathesis-3.19.1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  106. {schemathesis-3.18.5 → schemathesis-3.19.1}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  107. {schemathesis-3.18.5 → schemathesis-3.19.1}/.github/workflows/build.yml +0 -0
  108. {schemathesis-3.18.5 → schemathesis-3.19.1}/.github/workflows/codeql-analysis.yml +0 -0
  109. {schemathesis-3.18.5 → schemathesis-3.19.1}/.github/workflows/commit.yml +0 -0
  110. {schemathesis-3.18.5 → schemathesis-3.19.1}/.github/workflows/example-build.yml +0 -0
  111. {schemathesis-3.18.5 → schemathesis-3.19.1}/.github/workflows/example-no-build.yml +0 -0
  112. {schemathesis-3.18.5 → schemathesis-3.19.1}/.github/workflows/master_update.yml +0 -0
  113. {schemathesis-3.18.5 → schemathesis-3.19.1}/.github/workflows/release.yml +0 -0
  114. {schemathesis-3.18.5 → schemathesis-3.19.1}/.gitignore +0 -0
  115. {schemathesis-3.18.5 → schemathesis-3.19.1}/.gitmodules +0 -0
  116. {schemathesis-3.18.5 → schemathesis-3.19.1}/.readthedocs.yml +0 -0
  117. {schemathesis-3.18.5 → schemathesis-3.19.1}/.relint.yml +0 -0
  118. {schemathesis-3.18.5 → schemathesis-3.19.1}/.rstcheck.cfg +0 -0
  119. {schemathesis-3.18.5 → schemathesis-3.19.1}/.yamllint +0 -0
  120. {schemathesis-3.18.5 → schemathesis-3.19.1}/CODE_OF_CONDUCT.md +0 -0
  121. {schemathesis-3.18.5 → schemathesis-3.19.1}/CONTRIBUTING.rst +0 -0
  122. {schemathesis-3.18.5 → schemathesis-3.19.1}/Dockerfile +0 -0
  123. {schemathesis-3.18.5 → schemathesis-3.19.1}/Dockerfile.buster +0 -0
  124. {schemathesis-3.18.5 → schemathesis-3.19.1}/LICENSE +0 -0
  125. {schemathesis-3.18.5 → schemathesis-3.19.1}/changelog.py +0 -0
  126. {schemathesis-3.18.5 → schemathesis-3.19.1}/docs/Makefile +0 -0
  127. {schemathesis-3.18.5 → schemathesis-3.19.1}/docs/api.rst +0 -0
  128. {schemathesis-3.18.5 → schemathesis-3.19.1}/docs/compatibility.rst +0 -0
  129. {schemathesis-3.18.5 → schemathesis-3.19.1}/docs/conf.py +0 -0
  130. {schemathesis-3.18.5 → schemathesis-3.19.1}/docs/continuous_integration.rst +0 -0
  131. {schemathesis-3.18.5 → schemathesis-3.19.1}/docs/contrib.rst +0 -0
  132. {schemathesis-3.18.5 → schemathesis-3.19.1}/docs/examples.rst +0 -0
  133. {schemathesis-3.18.5 → schemathesis-3.19.1}/docs/extending.rst +0 -0
  134. {schemathesis-3.18.5 → schemathesis-3.19.1}/docs/faq.rst +0 -0
  135. {schemathesis-3.18.5 → schemathesis-3.19.1}/docs/graphql.rst +0 -0
  136. {schemathesis-3.18.5 → schemathesis-3.19.1}/docs/how.rst +0 -0
  137. {schemathesis-3.18.5 → schemathesis-3.19.1}/docs/index.rst +0 -0
  138. {schemathesis-3.18.5 → schemathesis-3.19.1}/docs/introduction.rst +0 -0
  139. {schemathesis-3.18.5 → schemathesis-3.19.1}/docs/recipes.rst +0 -0
  140. {schemathesis-3.18.5 → schemathesis-3.19.1}/docs/requirements.txt +0 -0
  141. {schemathesis-3.18.5 → schemathesis-3.19.1}/docs/service.rst +0 -0
  142. {schemathesis-3.18.5 → schemathesis-3.19.1}/docs/stateful.rst +0 -0
  143. {schemathesis-3.18.5 → schemathesis-3.19.1}/docs/targeted.rst +0 -0
  144. {schemathesis-3.18.5 → schemathesis-3.19.1}/example/Dockerfile +0 -0
  145. {schemathesis-3.18.5 → schemathesis-3.19.1}/example/app/app.py +0 -0
  146. {schemathesis-3.18.5 → schemathesis-3.19.1}/example/app/db.py +0 -0
  147. {schemathesis-3.18.5 → schemathesis-3.19.1}/example/app/openapi.yaml +0 -0
  148. {schemathesis-3.18.5 → schemathesis-3.19.1}/example/app/validation.py +0 -0
  149. {schemathesis-3.18.5 → schemathesis-3.19.1}/example/app/views.py +0 -0
  150. {schemathesis-3.18.5 → schemathesis-3.19.1}/example/database/schema.sql +0 -0
  151. {schemathesis-3.18.5 → schemathesis-3.19.1}/example/docker-compose.yml +0 -0
  152. {schemathesis-3.18.5 → schemathesis-3.19.1}/example/main.py +0 -0
  153. {schemathesis-3.18.5 → schemathesis-3.19.1}/example/test/__init__.py +0 -0
  154. {schemathesis-3.18.5 → schemathesis-3.19.1}/example/test/conftest.py +0 -0
  155. {schemathesis-3.18.5 → schemathesis-3.19.1}/example/test/hooks.py +0 -0
  156. {schemathesis-3.18.5 → schemathesis-3.19.1}/example/test/test_app.py +0 -0
  157. {schemathesis-3.18.5 → schemathesis-3.19.1}/img/demo.gif +0 -0
  158. {schemathesis-3.18.5 → schemathesis-3.19.1}/img/service_api_created.png +0 -0
  159. {schemathesis-3.18.5 → schemathesis-3.19.1}/img/service_api_form.png +0 -0
  160. {schemathesis-3.18.5 → schemathesis-3.19.1}/img/service_github_report.png +0 -0
  161. {schemathesis-3.18.5 → schemathesis-3.19.1}/img/service_no_apis_yet.png +0 -0
  162. {schemathesis-3.18.5 → schemathesis-3.19.1}/img/service_non_conforming_response.png +0 -0
  163. {schemathesis-3.18.5 → schemathesis-3.19.1}/img/service_run_results.png +0 -0
  164. {schemathesis-3.18.5 → schemathesis-3.19.1}/img/service_server_error.png +0 -0
  165. {schemathesis-3.18.5 → schemathesis-3.19.1}/mypy.ini +0 -0
  166. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/_compat.py +0 -0
  167. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/_hypothesis.py +0 -0
  168. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/checks.py +0 -0
  169. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/cli/constants.py +0 -0
  170. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/cli/handlers.py +0 -0
  171. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/cli/output/__init__.py +0 -0
  172. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/cli/output/short.py +0 -0
  173. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/contrib/__init__.py +0 -0
  174. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/contrib/openapi/__init__.py +0 -0
  175. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/contrib/openapi/formats/__init__.py +0 -0
  176. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/contrib/openapi/formats/uuid.py +0 -0
  177. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/contrib/unique_data.py +0 -0
  178. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/extra/__init__.py +0 -0
  179. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/extra/_aiohttp.py +0 -0
  180. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/extra/_flask.py +0 -0
  181. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/extra/_server.py +0 -0
  182. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/fixups/__init__.py +0 -0
  183. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/fixups/fast_api.py +0 -0
  184. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/fixups/utf8_bom.py +0 -0
  185. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/graphql.py +0 -0
  186. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/internal.py +0 -0
  187. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/py.typed +0 -0
  188. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/runner/__init__.py +0 -0
  189. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/runner/impl/__init__.py +0 -0
  190. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/service/__init__.py +0 -0
  191. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/service/auth.py +0 -0
  192. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/service/constants.py +0 -0
  193. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/service/usage.py +0 -0
  194. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/__init__.py +0 -0
  195. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/graphql/__init__.py +0 -0
  196. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/graphql/nodes.py +0 -0
  197. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/graphql/scalars.py +0 -0
  198. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/__init__.py +0 -0
  199. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/_hypothesis.py +0 -0
  200. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/checks.py +0 -0
  201. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/constants.py +0 -0
  202. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/converter.py +0 -0
  203. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/definitions.py +0 -0
  204. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/examples.py +0 -0
  205. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/expressions/__init__.py +0 -0
  206. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/expressions/errors.py +0 -0
  207. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/filters.py +0 -0
  208. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/negative/types.py +0 -0
  209. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/negative/utils.py +0 -0
  210. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/serialization.py +0 -0
  211. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/stateful/__init__.py +0 -0
  212. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/utils.py +0 -0
  213. {schemathesis-3.18.5 → schemathesis-3.19.1}/src/schemathesis/specs/openapi/validation.py +0 -0
  214. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/__init__.py +0 -0
  215. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/apps/__init__.py +0 -0
  216. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/apps/_graphql/__init__.py +0 -0
  217. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/apps/_graphql/_fastapi/__init__.py +0 -0
  218. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/apps/_graphql/_fastapi/app.py +0 -0
  219. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/apps/_graphql/_flask/__init__.py +0 -0
  220. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/apps/_graphql/_flask/app.py +0 -0
  221. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/apps/_graphql/schema.py +0 -0
  222. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/apps/openapi/__init__.py +0 -0
  223. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/apps/openapi/_aiohttp/__init__.py +0 -0
  224. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/apps/openapi/_aiohttp/app.py +0 -0
  225. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/apps/openapi/_aiohttp/handlers.py +0 -0
  226. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/apps/openapi/_fastapi/__init__.py +0 -0
  227. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/apps/openapi/_fastapi/app.py +0 -0
  228. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/apps/openapi/_flask/__init__.py +0 -0
  229. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/apps/openapi/_flask/app.py +0 -0
  230. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/apps/openapi/schema.py +0 -0
  231. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/auth/__init__.py +0 -0
  232. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/auth/conftest.py +0 -0
  233. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/cli/__init__.py +0 -0
  234. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/cli/cert.pem +0 -0
  235. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/cli/conftest.py +0 -0
  236. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/cli/output/__init__.py +0 -0
  237. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/cli/output/test_default.py +0 -0
  238. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/cli/test_asgi.py +0 -0
  239. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/cli/test_cassettes.py +0 -0
  240. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/cli/test_checks.py +0 -0
  241. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/cli/test_crashes.py +0 -0
  242. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/cli/test_hooks.py +0 -0
  243. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/cli/test_junitxml.py +0 -0
  244. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/cli/test_targeted.py +0 -0
  245. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/code_samples/test_curl.py +0 -0
  246. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/code_samples/test_python.py +0 -0
  247. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/contrib/openapi/formats/test_uuid.py +0 -0
  248. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/contrib/test_install.py +0 -0
  249. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/data/petstore_v2.yaml +0 -0
  250. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/data/petstore_v3.yaml +0 -0
  251. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/data/simple_openapi.yaml +0 -0
  252. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/data/simple_swagger.yaml +0 -0
  253. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/extra/__init__.py +0 -0
  254. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/extra/test_aiohttp.py +0 -0
  255. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/loaders/conftest.py +0 -0
  256. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/loaders/test_graphql.py +0 -0
  257. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/loaders/test_openapi.py +0 -0
  258. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/runner/test_checks.py +0 -0
  259. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/runner/test_events.py +0 -0
  260. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/service/__init__.py +0 -0
  261. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/service/test_auth.py +0 -0
  262. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/service/test_ci.py +0 -0
  263. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/service/test_serialization.py +0 -0
  264. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/specs/graphql/test_custom_scalars.py +0 -0
  265. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/specs/graphql/test_pytest.py +0 -0
  266. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/specs/openapi/parameters/test_forms.py +0 -0
  267. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/specs/openapi/parameters/test_non_payload.py +0 -0
  268. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/specs/openapi/parameters/test_simple_payloads.py +0 -0
  269. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/specs/openapi/test_examples.py +0 -0
  270. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/specs/openapi/test_expressions.py +0 -0
  271. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/specs/openapi/test_hypothesis.py +0 -0
  272. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/specs/openapi/test_links.py +0 -0
  273. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/specs/openapi/test_negative.py +0 -0
  274. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/specs/openapi/test_openapi_checks.py +0 -0
  275. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/specs/openapi/test_parameters.py +0 -0
  276. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/specs/openapi/test_schemas.py +0 -0
  277. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/specs/openapi/test_serializing.py +0 -0
  278. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/specs/openapi/test_stateful.py +0 -0
  279. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/specs/openapi/test_utils.py +0 -0
  280. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_app.py +0 -0
  281. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_asgi.py +0 -0
  282. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_async.py +0 -0
  283. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_common_parameters.py +0 -0
  284. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_converter.py +0 -0
  285. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_dereferencing.py +0 -0
  286. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_direct_access.py +0 -0
  287. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_examples.py +0 -0
  288. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_filters.py +0 -0
  289. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_fixups.py +0 -0
  290. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_hypothesis.py +0 -0
  291. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_internal.py +0 -0
  292. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_package.py +0 -0
  293. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_parameters.py +0 -0
  294. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_parametrization.py +0 -0
  295. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_petstore.py +0 -0
  296. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_pytest.py +0 -0
  297. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_recoverable_errors.py +0 -0
  298. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_required.py +0 -0
  299. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_schemas.py +0 -0
  300. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_serialization.py +0 -0
  301. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_unittest.py +0 -0
  302. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_utils.py +0 -0
  303. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_wsgi.py +0 -0
  304. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/test_yaml.py +0 -0
  305. {schemathesis-3.18.5 → schemathesis-3.19.1}/test/utils.py +0 -0
  306. {schemathesis-3.18.5 → schemathesis-3.19.1}/test-corpus/flaky.json +0 -0
  307. {schemathesis-3.18.5 → schemathesis-3.19.1}/test-corpus/incompatible_enums.json +0 -0
  308. {schemathesis-3.18.5 → schemathesis-3.19.1}/test-corpus/incompatible_regex.json +0 -0
  309. {schemathesis-3.18.5 → schemathesis-3.19.1}/test-corpus/incomplete_azure.json +0 -0
  310. {schemathesis-3.18.5 → schemathesis-3.19.1}/test-corpus/invalid_path_parameters.json +0 -0
  311. {schemathesis-3.18.5 → schemathesis-3.19.1}/test-corpus/recursive_references.json +0 -0
  312. {schemathesis-3.18.5 → schemathesis-3.19.1}/test-corpus/test_corpus.py +0 -0
  313. {schemathesis-3.18.5 → schemathesis-3.19.1}/test_server.sh +0 -0
@@ -17,15 +17,15 @@ jobs:
17
17
 
18
18
  - uses: actions/setup-python@v3.1.0
19
19
  with:
20
- python-version: "3.8"
20
+ python-version: "3.11"
21
21
 
22
22
  - run: sudo apt-get update && sudo apt-get install -y --no-install-recommends sqlite3
23
23
 
24
24
  - run: pip install mutmut
25
+ - run: pip install ".[tests]"
25
26
 
26
27
  - name: Run mutmut tests
27
28
  run: mutmut run
28
- --backup
29
29
  --paths-to-mutate "src/"
30
30
  --tests-dir "test/"
31
31
  --paths-to-exclude=definitions.py
@@ -50,9 +50,9 @@ jobs:
50
50
 
51
51
  - uses: actions/setup-python@v3.1.0
52
52
  with:
53
- python-version: 3.8
53
+ python-version: "3.11"
54
54
 
55
- - run: pip install .
55
+ - run: pip install ".[tests]"
56
56
  - run: pytest -m hypothesis -m hypothesis_nested --hypothesis-profile CI test
57
57
 
58
58
  test-corpus-part-1:
@@ -66,9 +66,9 @@ jobs:
66
66
 
67
67
  - uses: actions/setup-python@v3.1.0
68
68
  with:
69
- python-version: 3.8
69
+ python-version: "3.11"
70
70
 
71
- - run: pip install .
71
+ - run: pip install ".[tests]"
72
72
  # Azure.com APIs take >50% of all APIs in the test corpus
73
73
  - run: pytest test-corpus -k 'azure.com'
74
74
 
@@ -83,9 +83,9 @@ jobs:
83
83
 
84
84
  - uses: actions/setup-python@v3.1.0
85
85
  with:
86
- python-version: 3.8
86
+ python-version: "3.11"
87
87
 
88
- - run: pip install .
88
+ - run: pip install ".[tests]"
89
89
  # It matches 'microsoft.com/graph/1.0.1/openapi.yaml' that has >5000 API operations.
90
90
  # Running tests only for this API takes a lot of time and worth having a separate job due to the max time limit
91
91
  - run: pytest test-corpus -k 'microsoft.com and graph'
@@ -101,9 +101,9 @@ jobs:
101
101
 
102
102
  - uses: actions/setup-python@v3.1.0
103
103
  with:
104
- python-version: 3.8
104
+ python-version: "3.11"
105
105
 
106
- - run: pip install .
106
+ - run: pip install ".[tests]"
107
107
  # It matches all Amazon APIs
108
108
  - run: pytest test-corpus -k 'amazonaws.com'
109
109
 
@@ -118,9 +118,9 @@ jobs:
118
118
 
119
119
  - uses: actions/setup-python@v3.1.0
120
120
  with:
121
- python-version: 3.8
121
+ python-version: "3.11"
122
122
 
123
- - run: pip install .
123
+ - run: pip install ".[tests]"
124
124
  # It matches all Google APIs
125
125
  - run: pytest test-corpus -k 'googleapis.com'
126
126
 
@@ -135,8 +135,8 @@ jobs:
135
135
 
136
136
  - uses: actions/setup-python@v3.1.0
137
137
  with:
138
- python-version: 3.8
138
+ python-version: "3.11"
139
139
 
140
- - run: pip install .
140
+ - run: pip install ".[tests]"
141
141
  # It matches everything except that large MS API and all Azure.com | Amazon | Google APIs
142
142
  - run: pytest test-corpus -k 'not (microsoft.com and graph) and not azure.com and not amazonaws.com and not googleapis.com'
@@ -20,7 +20,7 @@ repos:
20
20
  - id: prettier
21
21
 
22
22
  - repo: https://github.com/jorisroovers/gitlint
23
- rev: v0.19.0dev
23
+ rev: v0.19.1
24
24
  hooks:
25
25
  - id: gitlint
26
26
 
@@ -54,16 +54,15 @@ repos:
54
54
  additional_dependencies: ["isort[pyproject]"]
55
55
 
56
56
  - repo: https://github.com/pre-commit/mirrors-mypy
57
- rev: v1.0.0
57
+ rev: v1.0.1
58
58
  hooks:
59
59
  - id: mypy
60
60
  exclude: ^(docs/|test/|test-corpus/|example/).*$
61
61
  args: ["--ignore-missing-imports"]
62
- additional_dependencies:
63
- [types-attrs, types-click, types-requests, types-PyYAML]
62
+ additional_dependencies: [types-click, types-requests, types-PyYAML]
64
63
 
65
64
  - repo: https://github.com/charliermarsh/ruff-pre-commit
66
- rev: "v0.0.247"
65
+ rev: "v0.0.248"
67
66
  hooks:
68
67
  - id: ruff
69
68
 
@@ -0,0 +1,24 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use this software, please cite it as below."
3
+ authors:
4
+ - family-names: "Hatfield-Dodds"
5
+ given-names: "Zac"
6
+ orcid: "https://orcid.org/0000-0002-8646-8362"
7
+ - family-names: "Dygalo"
8
+ given-names: "Dmitry"
9
+ title: "Schemathesis"
10
+ version: 3.8.15
11
+ date-released: 2023-02-18
12
+ url: "https://github.com/schemathesis/schemathesis"
13
+ preferred-citation:
14
+ type: article
15
+ authors:
16
+ - family-names: "Hatfield-Dodds"
17
+ given-names: "Zac"
18
+ orcid: "https://orcid.org/0000-0002-8646-8362"
19
+ - family-names: "Dygalo"
20
+ given-names: "Dmitry"
21
+ title: "Deriving Semantics-Aware Fuzzers from Web API Schemas"
22
+ doi: "10.48550/arXiv.2112.10328"
23
+ date-released: 2021-12-20
24
+ url: "https://arxiv.org/abs/2112.10328"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: schemathesis
3
- Version: 3.18.5
3
+ Version: 3.19.1
4
4
  Summary: Property-based testing framework for Open API and GraphQL based apps
5
5
  Project-URL: Documentation, https://schemathesis.readthedocs.io/en/stable/
6
6
  Project-URL: Changelog, https://schemathesis.readthedocs.io/en/stable/changelog.html
@@ -28,7 +28,6 @@ Classifier: Programming Language :: Python :: 3.11
28
28
  Classifier: Programming Language :: Python :: Implementation :: CPython
29
29
  Classifier: Topic :: Software Development :: Testing
30
30
  Requires-Python: >=3.7
31
- Requires-Dist: attrs>=22.1
32
31
  Requires-Dist: backoff<3.0,>=2.1.2
33
32
  Requires-Dist: click<9.0,>=7.0
34
33
  Requires-Dist: colorama<1.0,>=0.4
@@ -40,10 +39,11 @@ Requires-Dist: hypothesis<7,>=6.13.3
40
39
  Requires-Dist: importlib-metadata!=3.8,<5,>=1.1; python_version < '3.8'
41
40
  Requires-Dist: jsonschema<5.0,>=4.3.2
42
41
  Requires-Dist: junit-xml<2.0,>=1.9
42
+ Requires-Dist: pyrate-limiter<3.0,>=2.10
43
43
  Requires-Dist: pytest-subtests<0.8.0,>=0.2.1
44
44
  Requires-Dist: pytest<8,>=4.6.4
45
45
  Requires-Dist: pyyaml<7.0,>=5.1
46
- Requires-Dist: requests<=2.28.1,>=2.22
46
+ Requires-Dist: requests<2.29,>=2.22
47
47
  Requires-Dist: starlette-testclient==0.2.0
48
48
  Requires-Dist: starlette<1,>=0.13
49
49
  Requires-Dist: tomli-w<2.0,>=1.0.0
@@ -277,6 +277,7 @@ to Schemathesis, see the [contributing guidelines](https://github.com/schemathes
277
277
  - [An article](https://dygalo.dev/blog/schemathesis-property-based-testing-for-api-schemas/) about Schemathesis by **@Stranger6667**
278
278
  - [Effective API schemas testing](https://youtu.be/VVLZ25JgjD4) from DevConf.cz by **@Stranger6667**
279
279
  - [How to use Schemathesis to test Flask API in GitHub Actions](https://notes.lina-is-here.com/2022/08/04/schemathesis-docker-compose.html) by **@lina-is-here**
280
+ - [Testing APIFlask with schemathesis](http://blog.pamelafox.org/2023/02/testing-apiflask-with-schemathesis.html) by **@pamelafox**
280
281
  - [A video](https://www.youtube.com/watch?v=9FHRwrv-xuQ) from EuroPython 2020 by **@hultner**
281
282
  - [Schemathesis tutorial](https://appdev.consulting.redhat.com/tracks/contract-first/automated-testing-with-schemathesis.html) with an accompanying [video](https://www.youtube.com/watch?v=4r7OC-lBKMg) by Red Hat
282
283
  - [Using Hypothesis and Schemathesis to Test FastAPI](https://testdriven.io/blog/fastapi-hypothesis/) by **@amalshaji**
@@ -203,6 +203,7 @@ to Schemathesis, see the [contributing guidelines](https://github.com/schemathes
203
203
  - [An article](https://dygalo.dev/blog/schemathesis-property-based-testing-for-api-schemas/) about Schemathesis by **@Stranger6667**
204
204
  - [Effective API schemas testing](https://youtu.be/VVLZ25JgjD4) from DevConf.cz by **@Stranger6667**
205
205
  - [How to use Schemathesis to test Flask API in GitHub Actions](https://notes.lina-is-here.com/2022/08/04/schemathesis-docker-compose.html) by **@lina-is-here**
206
+ - [Testing APIFlask with schemathesis](http://blog.pamelafox.org/2023/02/testing-apiflask-with-schemathesis.html) by **@pamelafox**
206
207
  - [A video](https://www.youtube.com/watch?v=9FHRwrv-xuQ) from EuroPython 2020 by **@hultner**
207
208
  - [Schemathesis tutorial](https://appdev.consulting.redhat.com/tracks/contract-first/automated-testing-with-schemathesis.html) with an accompanying [video](https://www.youtube.com/watch?v=4r7OC-lBKMg) by Red Hat
208
209
  - [Using Hypothesis and Schemathesis to Test FastAPI](https://testdriven.io/blog/fastapi-hypothesis/) by **@amalshaji**
@@ -166,7 +166,7 @@ The following example shows how to use auth only tests generated via the ``schem
166
166
  schema = schemathesis.from_uri("https://example.schemathesis.io/openapi.json")
167
167
 
168
168
 
169
- @schema.auth.register()
169
+ @schema.auth()
170
170
  class MyAuth:
171
171
  # Here goes your implementation
172
172
  ...
@@ -185,11 +185,111 @@ And this one shows auth applied only to the ``test_api`` function:
185
185
  ...
186
186
 
187
187
 
188
- @schema.auth.apply(MyAuth)
188
+ @schema.auth(MyAuth)
189
189
  @schema.parametrize()
190
190
  def test_api(case):
191
191
  ...
192
192
 
193
+ Conditional Authentication
194
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
195
+
196
+ Schemathesis offers a way to apply authentication to only a specific set of API operations during testing.
197
+ This is helpful when you need to test different authentication types for different API operations or when the API has a combination of authenticated and unauthenticated endpoints.
198
+
199
+ Multiple filters can be combined and applied to include or exclude API operations based on exact values, regular expressions, or custom functions.
200
+ Here is how you can apply auth to all API operations with the ``/users/`` path, but exclude the ``POST`` method.
201
+
202
+ .. code:: python
203
+
204
+ import schemathesis
205
+
206
+
207
+ @schemathesis.auth().apply_to(path="/users/").skip_for(method="POST")
208
+ class MyAuth:
209
+ # Here goes your implementation
210
+ ...
211
+
212
+
213
+ schema = schemathesis.from_uri("https://example.schemathesis.io/openapi.json")
214
+
215
+
216
+ @schema.auth(MyAuth).apply_to(path="/users/").skip_for(method="POST")
217
+ @schema.parametrize()
218
+ def test_api(case):
219
+ ...
220
+
221
+ .. note::
222
+
223
+ This decorator syntax is supported only on Python 3.9+. For older Python versions you need to bind separate variables for each term.
224
+
225
+ Basic rules:
226
+
227
+ - ``apply_to`` applies authentication to all API operations that match the filter term
228
+ - ``skip_for`` skips authentication for all API operations that match the filter term
229
+ - All conditions within a filter term are combined with the ``AND`` logic
230
+ - Each ``apply_to`` and ``skip_for`` term is combined with the ``OR`` logic
231
+ - Both ``apply_to`` and ``skip_for`` use the same set of conditions as arguments
232
+
233
+ Conditions:
234
+
235
+ - ``path``: the path of the API operation without its ``basePath``.
236
+ - ``method``: the upper-cased HTTP method of the API operation
237
+ - ``name``: the name of the API operation, such as ``GET /users/`` or ``Query.getUsers``
238
+ - Each condition can take either a single string or a list of options as input
239
+ - You can also use a regular expression to match the conditions by adding ``_regex`` to the end of the condition and passing a string or a compiled regex.
240
+
241
+ Here are some examples for ``path``, other conditions works the same:
242
+
243
+ .. code:: python
244
+
245
+ import re
246
+ import schemathesis
247
+
248
+ schema = schemathesis.from_uri("https://example.schemathesis.io/openapi.json")
249
+
250
+
251
+ # Only `/users/`
252
+ @schema.auth().apply_to(path="/users/")
253
+ # Only `/users/` and `/orders/`
254
+ @schema.auth().apply_to(path=["/users/", "/orders/"])
255
+ # Only paths starting with `/u`
256
+ @schema.auth().apply_to(path_regex="^/u")
257
+ # Only paths starting with `/u` case insensitive
258
+ @schema.auth().apply_to(path_regex=re.compile("^/u", re.IGNORECASE))
259
+ # Only `GET /users/` or `POST /orders/`
260
+ @schema.auth().apply_to(
261
+ method="GET",
262
+ path="/users/",
263
+ ).apply_to(
264
+ method="POST",
265
+ path="/orders/",
266
+ )
267
+ class MyAuth:
268
+ # Here goes your implementation
269
+ ...
270
+
271
+ You can also use a custom function to determine whether to apply or skip authentication for a given operation.
272
+ The function should take an ``AuthContext`` instance and return a boolean value.
273
+
274
+ To use a custom function with ``apply_to`` or ``skip_for``, simply pass it as the first argument. For example:
275
+
276
+ .. code:: python
277
+
278
+ import schemathesis
279
+
280
+ schema = schemathesis.from_uri("https://example.schemathesis.io/openapi.json")
281
+
282
+
283
+ def is_deprecated(ctx):
284
+ return ctx.operation.definition.get("deprecated") is True
285
+
286
+
287
+ # Skip auth for all deprecated API operations
288
+ @schema.auth().skip_for(is_deprecated)
289
+ class MyAuth:
290
+ # Here goes your implementation
291
+ ...
292
+
193
293
  Refreshing credentials
194
294
  ~~~~~~~~~~~~~~~~~~~~~~
195
295
 
@@ -230,7 +330,7 @@ It could be done by using the ``context`` to get the application instance:
230
330
  PASSWORD = "test"
231
331
 
232
332
 
233
- @schema.auth.register()
333
+ @schema.auth()
234
334
  class MyAuth:
235
335
  def get(self, context):
236
336
  client = TestClient(context.app)
@@ -257,7 +357,7 @@ It could be done by using the ``context`` to get the application instance:
257
357
  PASSWORD = "test"
258
358
 
259
359
 
260
- @schema.auth.register()
360
+ @schema.auth()
261
361
  class MyAuth:
262
362
  def get(self, context):
263
363
  client = werkzeug.Client(context.app)
@@ -324,8 +424,27 @@ Third-party implementation
324
424
 
325
425
  If you'd like to use an authentication mechanism that is not natively supported by Schemathesis, you can use third-party extensions to the ``requests`` library inside Schemathesis tests.
326
426
 
427
+ You can pass a ``requests.auth.AuthBase`` subclass instance to ``auth.set_from_requests`` and Schemathesis will use it automatically for every request it makes during testing.
428
+
429
+ .. important::
430
+
431
+ Note, that this feature works only over HTTP and Python's WSGI transport is not supported.
432
+
327
433
  Here is an example that uses the `requests-ntlm <https://github.com/requests/requests-ntlm>`_ library that supports the `NTLM HTTP Authentication <https://datatracker.ietf.org/doc/html/rfc4559>`_ protocol.
328
434
 
435
+ .. code:: python
436
+
437
+ import schemathesis
438
+ from requests_ntlm import HttpNtlmAuth
439
+
440
+ schemathesis.auth.set_from_requests(HttpNtlmAuth("domain\\username", "password"))
441
+
442
+ .. note::
443
+
444
+ You'll need to load this code as any other hook for CLI.
445
+
446
+ For Python tests it works similarly:
447
+
329
448
  .. code-block:: python
330
449
 
331
450
  import schemathesis
@@ -333,14 +452,12 @@ Here is an example that uses the `requests-ntlm <https://github.com/requests/req
333
452
 
334
453
  schema = schemathesis.from_uri("https://example.schemathesis.io/openapi.json")
335
454
 
455
+ schema.auth.set_from_requests(HttpNtlmAuth("domain\\username", "password"))
456
+
336
457
 
337
458
  @schema.parametrize()
338
459
  def test_api(case):
339
- case.call_and_validate(auth=HttpNtlmAuth("domain\\username", "password"))
340
-
341
- .. note::
342
-
343
- These extensions are not supported in Schemathesis CLI yet.
460
+ ...
344
461
 
345
462
  Custom test client in Python tests
346
463
  ----------------------------------
@@ -4,6 +4,88 @@ Changelog
4
4
  `Unreleased`_ - TBD
5
5
  -------------------
6
6
 
7
+ .. _v3.19.1:
8
+
9
+ `3.19.1`_ - 2023-04-26
10
+ ----------------------
11
+
12
+ **Changed**
13
+
14
+ - Support ``requests<2.29``.
15
+
16
+ **Fixed**
17
+
18
+ - Passing ``params`` / ``cookies`` to ``case.call`` causing ``TypeError``. `#1734`_
19
+
20
+ **Removed**
21
+
22
+ - Direct dependency on ``attrs``.
23
+
24
+ .. _v3.19.0:
25
+
26
+ `3.19.0`_ - 2023-03-22
27
+ ----------------------
28
+
29
+ **Added**
30
+
31
+ - Schemathesis now supports custom authentication mechanisms from the ``requests`` library.
32
+ You can use ``schemathesis.auth.set_from_requests`` to set up Schemathesis CLI with any third-party authentication implementation that works with ``requests``. `#1700`_
33
+
34
+ .. code:: python
35
+
36
+ import schemathesis
37
+ from requests_ntlm import HttpNtlmAuth
38
+
39
+ schemathesis.auth.set_from_requests(HttpNtlmAuth("domain\\username", "password"))
40
+
41
+ - Ability to apply authentication conditionally to specific API operations using a combination of ``@schemathesis.auth.apply_to()`` and ``@schemathesis.auth.skip_for()`` decorators.
42
+
43
+ .. code:: python
44
+
45
+ import schemathesis
46
+
47
+
48
+ # Apply auth only for operations that path starts with `/users/` but not the `POST` method
49
+ @schemathesis.auth().apply_to(path_regex="^/users/").skip_for(method="POST")
50
+ class MyAuth:
51
+ ...
52
+
53
+ - Add a convenience mapping-like interface to ``OperationDefinition`` including indexing access, the ``get`` method, and "in" support.
54
+ - Request throttling via the ``--rate-limit`` CLI option. `#910`_
55
+
56
+ **Changed**
57
+
58
+ - Unified Schemathesis custom authentication usage via the ``schema.auth`` decorator, replacing the previous ``schema.auth.register`` and ``schema.auth.apply`` methods:
59
+
60
+ .. code:: python
61
+
62
+ import schemathesis
63
+
64
+ schema = schemathesis.from_uri("https://example.schemathesis.io/openapi.json")
65
+
66
+
67
+ # Schema-level auth
68
+ # Before: @schema.auth.register()
69
+ @schema.auth()
70
+ class MyAuth:
71
+ ...
72
+
73
+
74
+ # Test-level auth
75
+ # Before: @schema.auth.apply(MyAuth)
76
+ @schema.auth(MyAuth)
77
+ @schema.parametrize()
78
+ def test_api(case):
79
+ ...
80
+
81
+ **Fixed**
82
+
83
+ - Handling of query parameters and cookies passed to ``case.call`` and query parameters passed to ``case.call_wsgi``.
84
+ The user-provided values are now merged with the data generated by Schemathesis, instead of overriding it completely. `#1705`_
85
+ - Parameter definition takes precedence over security schemes with the same name.
86
+ - ``Unsatisfiable`` error when explicit header name passed via CLI clashes with the header parameter name. `#1699`_
87
+ - Not using the ``port`` keyword argument in schema loaders during API schema loading. `#1721`_
88
+
7
89
  .. _v3.18.5:
8
90
 
9
91
  `3.18.5`_ - 2023-02-18
@@ -3028,7 +3110,9 @@ Deprecated
3028
3110
 
3029
3111
  - Initial public release
3030
3112
 
3031
- .. _Unreleased: https://github.com/schemathesis/schemathesis/compare/v3.18.5...HEAD
3113
+ .. _Unreleased: https://github.com/schemathesis/schemathesis/compare/v3.19.1...HEAD
3114
+ .. _3.19.1: https://github.com/schemathesis/schemathesis/compare/v3.19.0...v3.19.1
3115
+ .. _3.19.0: https://github.com/schemathesis/schemathesis/compare/v3.18.5...v3.19.0
3032
3116
  .. _3.18.5: https://github.com/schemathesis/schemathesis/compare/v3.18.4...v3.18.5
3033
3117
  .. _3.18.4: https://github.com/schemathesis/schemathesis/compare/v3.18.3...v3.18.4
3034
3118
  .. _3.18.3: https://github.com/schemathesis/schemathesis/compare/v3.18.2...v3.18.3
@@ -3251,7 +3335,12 @@ Deprecated
3251
3335
  .. _0.3.0: https://github.com/schemathesis/schemathesis/compare/v0.2.0...v0.3.0
3252
3336
  .. _0.2.0: https://github.com/schemathesis/schemathesis/compare/v0.1.0...v0.2.0
3253
3337
 
3338
+ .. _#1734: https://github.com/schemathesis/schemathesis/issues/1734
3339
+ .. _#1721: https://github.com/schemathesis/schemathesis/issues/1721
3340
+ .. _#1705: https://github.com/schemathesis/schemathesis/issues/1705
3254
3341
  .. _#1702: https://github.com/schemathesis/schemathesis/issues/1702
3342
+ .. _#1700: https://github.com/schemathesis/schemathesis/issues/1700
3343
+ .. _#1699: https://github.com/schemathesis/schemathesis/issues/1699
3255
3344
  .. _#1695: https://github.com/schemathesis/schemathesis/issues/1695
3256
3345
  .. _#1669: https://github.com/schemathesis/schemathesis/issues/1669
3257
3346
  .. _#1643: https://github.com/schemathesis/schemathesis/issues/1643
@@ -3382,6 +3471,7 @@ Deprecated
3382
3471
  .. _#916: https://github.com/schemathesis/schemathesis/issues/916
3383
3472
  .. _#914: https://github.com/schemathesis/schemathesis/issues/914
3384
3473
  .. _#911: https://github.com/schemathesis/schemathesis/issues/911
3474
+ .. _#910: https://github.com/schemathesis/schemathesis/issues/910
3385
3475
  .. _#908: https://github.com/schemathesis/schemathesis/issues/908
3386
3476
  .. _#907: https://github.com/schemathesis/schemathesis/issues/907
3387
3477
  .. _#905: https://github.com/schemathesis/schemathesis/issues/905
@@ -491,6 +491,23 @@ Skipped check calls will not be reported in the run summary.
491
491
 
492
492
  Learn more about writing custom checks :ref:`here <writing-custom-checks>`.
493
493
 
494
+ Rate limiting
495
+ -------------
496
+
497
+ APIs implement rate limiting to prevent misuse of their resources.
498
+ Schemathesis CLI's ``--rate-limit`` option can be used to set the maximum number of requests per second, minute, hour, or day during testing to avoid hitting these limits.
499
+
500
+ .. code:: bash
501
+
502
+ # 3 requests per second
503
+ st run --rate-limit=3/s
504
+ # 100 requests per minute
505
+ st run --rate-limit=100/m
506
+ # 1000 requests per hour
507
+ st run --rate-limit=1000/h
508
+ # 10000 requests per day
509
+ st run --rate-limit=10000/d
510
+
494
511
  Debugging
495
512
  ---------
496
513
 
@@ -440,6 +440,29 @@ You only need to specify strategies for ``hypothesis.given``:
440
440
  def test_pets(self, case):
441
441
  case.call_and_validate()
442
442
 
443
+ Rate limiting
444
+ -------------
445
+
446
+ APIs implement rate limiting to prevent misuse of their resources.
447
+ Schema loaders accept the ``rate_limit`` argument that can be used to set the maximum number of requests per second, minute, hour, or day during testing to avoid hitting these limits.
448
+
449
+ .. code-block:: python
450
+
451
+ import schemathesis
452
+
453
+ # 3 requests per second - `3/s`
454
+ # 100 requests per minute - `100/m`
455
+ # 1000 requests per hour - `1000/h`
456
+ # 10000 requests per day - `10000/d`
457
+ RATE_LIMIT = "3/s"
458
+
459
+ schema = schemathesis.from_uri(
460
+ "https://example.schemathesis.io/openapi.json",
461
+ rate_limit=RATE_LIMIT,
462
+ )
463
+
464
+ ...
465
+
443
466
  Anatomy of a test
444
467
  -----------------
445
468
 
@@ -2,7 +2,7 @@ Example project
2
2
  ===============
3
3
 
4
4
  A simple web app, built with `connexion <https://github.com/zalando/connexion>`_,
5
- `aiohttp <https://github.com/aio-libs/aiohttp>`_, `attrs <https://github.com/python-attrs/attrs>`_ and `asyncpg <https://github.com/MagicStack/asyncpg>`_.
5
+ `aiohttp <https://github.com/aio-libs/aiohttp>`_ and `asyncpg <https://github.com/MagicStack/asyncpg>`_.
6
6
  It contains many intentional errors, which should be found by running Schemathesis.
7
7
 
8
8
  There is also `a tutorial <https://habr.com/ru/company/oleg-bunin/blog/576496/>`_ in Russian that follows this example project.
@@ -0,0 +1,10 @@
1
+ from dataclasses import dataclass, asdict as _asdict
2
+
3
+
4
+ @dataclass
5
+ class Booking:
6
+ id: int
7
+ name: str
8
+ is_active: bool
9
+
10
+ asdict = _asdict
@@ -1,5 +1,4 @@
1
1
  asyncpg
2
- attrs
3
2
  connexion[aiohttp,swagger-ui]
4
3
  # Test requirements are installed in the same environment
5
4
  pytest
@@ -26,7 +26,6 @@ attrs==21.4.0
26
26
  # hypothesis-graphql
27
27
  # jsonschema
28
28
  # pytest
29
- # schemathesis
30
29
  certifi==2022.12.7
31
30
  # via requests
32
31
  charset-normalizer==2.0.12
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "schemathesis"
7
- version = "3.18.5"
7
+ version = "3.19.1"
8
8
  description = "Property-based testing framework for Open API and GraphQL based apps"
9
9
  keywords = ["pytest", "hypothesis", "openapi", "swagger", "graphql", "testing"]
10
10
  authors = [{ name = "Dmitry Dygalo", email = "dadygalo@gmail.com" }]
@@ -31,7 +31,6 @@ classifiers = [
31
31
  "Topic :: Software Development :: Testing",
32
32
  ]
33
33
  dependencies = [
34
- "attrs>=22.1",
35
34
  "backoff>=2.1.2,<3.0",
36
35
  "click>=7.0,<9.0",
37
36
  "colorama>=0.4,<1.0",
@@ -43,10 +42,11 @@ dependencies = [
43
42
  "importlib_metadata>=1.1,!=3.8,<5; python_version<'3.8'",
44
43
  "jsonschema>=4.3.2,<5.0",
45
44
  "junit-xml>=1.9,<2.0",
45
+ "pyrate-limiter>=2.10,<3.0",
46
46
  "pytest-subtests>=0.2.1,<0.8.0",
47
47
  "pytest>=4.6.4,<8",
48
48
  "PyYAML>=5.1,<7.0",
49
- "requests>=2.22,<=2.28.1",
49
+ "requests>=2.22,<2.29",
50
50
  "starlette>=0.13,<1",
51
51
  "starlette-testclient==0.2.0",
52
52
  "tomli-w>=1.0.0,<2.0",
@@ -101,7 +101,7 @@ profile = "black"
101
101
  line_length = 120
102
102
  default_section = "THIRDPARTY"
103
103
  known_first_party = "schemathesis"
104
- known_third_party = ["_pytest", "aiohttp", "attr", "click", "curlify", "fastapi", "flask", "graphene", "graphql", "graphql_server", "hypothesis", "hypothesis_graphql", "hypothesis_jsonschema", "jsonschema", "junit_xml", "packaging", "pydantic", "pytest", "pytest_subtests", "requests", "schemathesis", "starlette", "typing_extensions", "urllib3", "werkzeug", "yaml", "yarl"]
104
+ known_third_party = ["_pytest", "aiohttp", "click", "curlify", "fastapi", "flask", "graphene", "graphql", "graphql_server", "hypothesis", "hypothesis_graphql", "hypothesis_jsonschema", "jsonschema", "junit_xml", "packaging", "pydantic", "pytest", "pytest_subtests", "requests", "schemathesis", "starlette", "typing_extensions", "urllib3", "werkzeug", "yaml", "yarl"]
105
105
 
106
106
  [tool.pytest.ini_options]
107
107
  addopts = ["-ra", "--strict-markers", "--strict-config"]
@@ -27,7 +27,7 @@ from_uri = openapi.from_uri
27
27
  from_wsgi = openapi.from_wsgi
28
28
 
29
29
  # Public API
30
- auth = auths.register
30
+ auth = auths.GLOBAL_AUTH_STORAGE
31
31
  check = checks.register
32
32
  hook = hooks.register
33
33
  serializer = serializers.register
@@ -37,5 +37,3 @@ target = targets.register
37
37
  register_check = checks.register
38
38
  register_target = targets.register
39
39
  register_string_format = openapi.format
40
-
41
- auth.__dict__["register"] = auths.register