Title: [Bug]: TestSearch.test_chars_valid test failure · Issue #855 · python-openapi/openapi-core · GitHub
Open Graph Title: [Bug]: TestSearch.test_chars_valid test failure · Issue #855 · python-openapi/openapi-core
X Title: [Bug]: TestSearch.test_chars_valid test failure · Issue #855 · python-openapi/openapi-core
Description: Actual Behavior Test failed Expected Behavior Test succeeds Steps to Reproduce Try to run the tests using ... python3 -m venv --clear --system-site-packages testenv testenv/bin/python3 -m installer dist/*.whl testenv/bin/python3 -m pytes...
Open Graph Description: Actual Behavior Test failed Expected Behavior Test succeeds Steps to Reproduce Try to run the tests using ... python3 -m venv --clear --system-site-packages testenv testenv/bin/python3 -m installer...
X Description: Actual Behavior Test failed Expected Behavior Test succeeds Steps to Reproduce Try to run the tests using ... python3 -m venv --clear --system-site-packages testenv testenv/bin/python3 -m installer...
Opengraph URL: https://github.com/python-openapi/openapi-core/issues/855
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: TestSearch.test_chars_valid test failure","articleBody":"### Actual Behavior\n\nTest failed\n\n### Expected Behavior\n\nTest succeeds\n\n### Steps to Reproduce\n\nTry to run the tests using ...\r\n\r\n```bash\r\npython3 -m venv --clear --system-site-packages testenv\r\ntestenv/bin/python3 -m installer dist/*.whl\r\ntestenv/bin/python3 -m pytest\r\n```\n\n### OpenAPI Core Version\n\n0.19.2\n\n### OpenAPI Core Integration\n\nNo integration\n\n### Affected Area(s)\n\ntesting\n\n### References\n\n_No response_\n\n### Anything else we need to know?\n\nPlease let me know if I am doing anything drastically wrong here, but I expect this to just work. Any help is greatly appreciated. :)\r\n\r\nThe tests worked fine with 0.19.1, the code for building the package on Alpine (and running the test suite) is here: https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/testing/py3-openapi-core/APKBUILD\r\n\r\nThe test environment is a clean Alpine Linux docker container with these additional packages:\r\n\r\npy3-isodate-pyc (0.6.1-r5)\r\npy3-isodate (0.6.1-r5) \r\npy3-more-itertools-pyc (10.2.0-r1)\r\npy3-more-itertools (10.2.0-r1) \r\npy3-openapi-spec-validator-pyc (0.7.1-r0)\r\npy3-openapi-spec-validator (0.7.1-r0)\r\npy3-jsonschema-path-pyc (0.3.2-r0)\r\npy3-jsonschema-path (0.3.2-r0)\r\npy3-pathable-pyc (0.4.3-r0)\r\npy3-pathable (0.4.3-r0) \r\npy3-openapi-schema-validator-pyc (0.6.2-r0)\r\npy3-openapi-schema-validator (0.6.2-r0)\r\npy3-jsonschema-pyc (4.22.0-r0)\r\npy3-jsonschema (4.22.0-r0) \r\npy3-jsonschema-specifications-pyc (2023.12.1-r1)\r\npy3-jsonschema-specifications (2023.12.1-r1)\r\npy3-referencing-pyc (0.35.1-r0)\r\npy3-referencing (0.35.1-r0)\r\npy3-rpds-py-pyc (0.18.1_git20240605-r0)\r\npy3-rpds-py (0.18.1_git20240605-r0)\r\npy3-rfc3339-validator-pyc (0.1.4-r0)\r\npy3-rfc3339-validator (0.1.4-r0)\r\npy3-six-pyc (1.16.0-r9)\r\npy3-six (1.16.0-r9)\r\npy3-lazy-object-proxy-pyc (1.10.0-r1)\r\npy3-lazy-object-proxy (1.10.0-r1)\r\npy3-parse-pyc (1.20.0-r1)\r\npy3-parse (1.20.0-r1)\r\npy3-gpep517-pyc (16-r0)\r\npy3-gpep517 (16-r0)\r\npy3-installer-pyc (0.7.0-r2)\r\npy3-installer (0.7.0-r2)\r\npy3-setuptools-pyc (70.0.0-r0)\r\npy3-setuptools (70.0.0-r0)\r\npy3-wheel-pyc (0.42.0-r1)\r\npy3-wheel (0.42.0-r1)\r\npy3-poetry-core-pyc (1.9.0-r0)\r\npy3-poetry-core (1.9.0-r0)\r\npy3-fastjsonschema-pyc (2.20.0-r0)\r\npy3-fastjsonschema (2.20.0-r0)\r\npy3-lark-parser-pyc (1.1.9-r1)\r\npy3-lark-parser (1.1.9-r1)\r\npy3-pytest-aiohttp-pyc (1.0.5-r3)\r\npy3-pytest-aiohttp (1.0.5-r3)\r\npy3-pytest-asyncio-pyc (0.23.6-r0)\r\npy3-pytest-asyncio (0.23.6-r0)\r\npy3-pytest-pyc (8.2.2-r0)\r\npy3-pytest (8.2.2-r0)\r\npy3-iniconfig-pyc (2.0.0-r1)\r\npy3-iniconfig (2.0.0-r1)\r\npy3-packaging-pyc (24.1-r0)\r\npy3-packaging (24.1-r0)\r\npy3-parsing-pyc (3.1.2-r1)\r\npy3-parsing (3.1.2-r1)\r\npy3-pluggy-pyc (1.5.0-r0)\r\npy3-pluggy (1.5.0-r0)\r\npy3-py-pyc (1.11.0-r3)\r\npy3-py (1.11.0-r3)\r\npy3-aiohttp-pyc (3.9.3-r1)\r\npy3-aiohttp (3.9.3-r1)\r\npy3-aiosignal-pyc (1.3.1-r3)\r\npy3-aiosignal (1.3.1-r3)\r\npy3-frozenlist-pyc (1.4.1-r1)\r\npy3-frozenlist (1.4.1-r1)\r\npy3-async-timeout-pyc (4.0.3-r1)\r\npy3-async-timeout (4.0.3-r1)\r\npy3-attrs-pyc (23.2.0-r1)\r\npy3-attrs (23.2.0-r1)\r\npy3-brotli-pyc (1.1.0-r2)\r\npy3-brotli (1.1.0-r2)\r\npy3-idna-ssl-pyc (1.1.0-r9)\r\npy3-idna-ssl (1.1.0-r9)\r\npy3-yarl-pyc (1.9.4-r1)\r\npy3-yarl (1.9.4-r1)\r\npy3-django-rest-framework-pyc (3.15.1-r2)\r\npy3-django-rest-framework (3.15.1-r2)\r\npy3-django-pyc (4.2.12-r0)\r\npy3-django (4.2.12-r0)\r\npy3-asgiref-pyc (3.8.1-r1)\r\npy3-asgiref (3.8.1-r1)\r\npy3-sqlparse-pyc (0.4.4-r2)\r\npy3-sqlparse (0.4.4-r2)\r\ntzdata (2024a-r1) \r\npy3-tz-pyc (2024.1-r1)\r\npy3-tz (2024.1-r1)\r\npy3-fastapi-pyc (0.111.0-r0)\r\npy3-fastapi (0.111.0-r0)\r\npy3-pydantic-pyc (2.6.4-r1)\r\npy3-pydantic (2.6.4-r1)\r\npy3-annotated-types-pyc (0.7.0-r0)\r\npy3-annotated-types (0.7.0-r0)\r\npy3-pydantic-core-pyc (2.16.3-r1)\r\npy3-pydantic-core (2.16.3-r1)\r\npy3-typing-extensions-pyc (4.11.0-r1)\r\npy3-typing-extensions (4.11.0-r1)\r\npy3-flask-pyc (3.0.3-r0)\r\npy3-flask (3.0.3-r0)\r\npy3-blinker-pyc (1.7.0-r1)\r\npy3-blinker (1.7.0-r1)\r\npy3-click-pyc (8.1.7-r2)\r\npy3-click (8.1.7-r2)\r\npy3-itsdangerous-pyc (2.1.2-r4)\r\npy3-itsdangerous (2.1.2-r4)\r\npy3-jinja2-pyc (3.1.4-r0)\r\npy3-jinja2 (3.1.4-r0)\r\npy3-werkzeug-pyc (3.0.3-r0)\r\npy3-werkzeug (3.0.3-r0)\r\npy3-markupsafe-pyc (2.1.5-r1)\r\npy3-markupsafe (2.1.5-r1)\r\npy3-httpx-pyc (0.27.0-r1)\r\npy3-httpx (0.27.0-r1)\r\npy3-httpcore-pyc (1.0.4-r1)\r\npy3-httpcore (1.0.4-r1)\r\npy3-h11-pyc (0.14.0-r4)\r\npy3-h11 (0.14.0-r4)\r\npy3-multidict-pyc (6.0.5-r1)\r\npy3-multidict (6.0.5-r1)\r\npy3-responses-pyc (0.25.0-r1)\r\npy3-responses (0.25.0-r1)\r\npy3-toml-pyc (0.10.2-r7)\r\npy3-toml (0.10.2-r7)\r\npy3-yaml-pyc (6.0.1-r3)\r\npy3-yaml (6.0.1-r3)\r\npy3-starlette-pyc (0.37.2-r2)\r\npy3-starlette (0.37.2-r2)\r\npy3-anyio-pyc (4.3.0-r2)\r\npy3-anyio (4.3.0-r2)\r\npy3-sniffio-pyc (1.3.1-r1)\r\npy3-sniffio (1.3.1-r1)\r\npy3-curio-pyc (1.6-r2)\r\npy3-curio (1.6-r2)\r\nccache (4.9.1-r0)\r\nhiredis (1.2.0-r0)\r\nyaml (0.2.5-r2)\r\n\r\n\r\nTest output:\r\n\r\n```\r\n \r\n================================================================ FAILURES =================================================================\r\n_________________________________________ TestSearch.test_chars_valid[/{test-id}/test-expected2] __________________________________________\r\n \r\nself = \u003ctest_templating_util.TestSearch object at 0x7a1665bd8290\u003e, path_pattern = '/{test-id}/test', expected = {'test-id': 'test'}\r\n \r\n @pytest.mark.parametrize( \r\n \"path_pattern,expected\", \r\n [ \r\n (\"/{test_id}/test\", {\"test_id\": \"test\"}),\r\n (\"/{test.id}/test\", {\"test.id\": \"test\"}),\r\n (\"/{test-id}/test\", {\"test-id\": \"test\"}),\r\n ], \r\n ) \r\n def test_chars_valid(self, path_pattern, expected):\r\n full_url_pattern = \"/test/test\" \r\n \r\n result = search(path_pattern, full_url_pattern)\r\n \r\n\u003e assert result.named == expected \r\nE AttributeError: 'NoneType' object has no attribute 'named'\r\n \r\nexpected = {'test-id': 'test'} \r\nfull_url_pattern = '/test/test' \r\npath_pattern = '/{test-id}/test' \r\nresult = None \r\nself = \u003ctest_templating_util.TestSearch object at 0x7a1665bd8290\u003e\r\n \r\ntests/unit/templating/test_templating_util.py:40: AttributeError\r\n-------------- generated xml file: /home/buildozer/aports/testing/py3-openapi-core/src/openapi-core-0.19.2/reports/junit.xml --------------\r\n========================================================= short test summary info =========================================================\r\nFAILED tests/unit/templating/test_templating_util.py::TestSearch::test_chars_valid[/{test-id}/test-expected2] - AttributeError: 'NoneType' \r\n```\r\n\r\nTest is run like this:\r\n\r\n```bash\r\n python3 -m venv --clear --system-site-packages testenv\r\n testenv/bin/python3 -m installer dist/*.whl\r\n testenv/bin/python3 -m pytest\r\n```\n\n### Would you like to implement a fix?\n\nNo","author":{"url":"https://github.com/Thermi","@type":"Person","name":"Thermi"},"datePublished":"2024-06-17T17:20:14.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/855/openapi-core/issues/855"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:76f2a5d1-18f2-436b-3c10-82b1d51dfc4f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 856C:25975D:1333DDF:1A81259:6977745D |
| html-safe-nonce | 832d67fa7ae6776fe55b2b059df59e01d54fbb66825a1f137b262e7c24bc2800 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTZDOjI1OTc1RDoxMzMzRERGOjFBODEyNTk6Njk3Nzc0NUQiLCJ2aXNpdG9yX2lkIjoiMTkwOTQ4MDY1MjY5NjY3OTUxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3a4f5d8b3a12950db4b61f64d8e3cd195610bf34fe307771b02791ae56b66800 |
| hovercard-subject-tag | issue:2357842780 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-openapi/openapi-core/855/issue_layout |
| twitter:image | https://opengraph.githubassets.com/609c9442452a5e406de6e1df59c97820d07ec6c30871cda1c395fba25b4ab326/python-openapi/openapi-core/issues/855 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/609c9442452a5e406de6e1df59c97820d07ec6c30871cda1c395fba25b4ab326/python-openapi/openapi-core/issues/855 |
| og:image:alt | Actual Behavior Test failed Expected Behavior Test succeeds Steps to Reproduce Try to run the tests using ... python3 -m venv --clear --system-site-packages testenv testenv/bin/python3 -m installer... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Thermi |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9fea6af76c6e24ca5c5728a18d4220d768790d04abe1ba6aafa18526daff96e7 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-openapi/openapi-core git https://github.com/python-openapi/openapi-core.git |
| octolytics-dimension-user_id | 126442889 |
| octolytics-dimension-user_login | python-openapi |
| octolytics-dimension-repository_id | 104200746 |
| octolytics-dimension-repository_nwo | python-openapi/openapi-core |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 104200746 |
| octolytics-dimension-repository_network_root_nwo | python-openapi/openapi-core |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6c4a3fa336c0d96309887d0be819777cadd37121 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width