Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fail with flask==3.1.0 #626

Open
ancieg opened this issue Nov 15, 2024 · 3 comments
Open

Tests fail with flask==3.1.0 #626

ancieg opened this issue Nov 15, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@ancieg
Copy link

ancieg commented Nov 15, 2024

Repro Steps

  1. Run test-suite with flask==3.1.0
  2. Broken!

Expected Behavior

Tests pass.

Actual Behavior

Tests fail.

Error Messages/Stack Trace

=================================== FAILURES ===================================
______________ SwaggerTest.test_specs_endpoint_host_and_subdomain ______________

self = <tests.test_swagger.SwaggerTest object at 0x7f604d793770>
app = <Flask 'tests.conftest'>, client = <TestClient <Flask 'tests.conftest'>>

    @pytest.mark.options(server_name="restx.org")
    def test_specs_endpoint_host_and_subdomain(self, app, client):
        blueprint = Blueprint("api", __name__, subdomain="api")
        restx.Api(blueprint)
        app.register_blueprint(blueprint)

>       data = client.get_specs(base_url="http://api.restx.org")

tests/test_swagger.py:182:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/conftest.py:42: in get_specs
    return self.get_json("{0}/swagger.json".format(prefix), status=status, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <TestClient <Flask 'tests.conftest'>>, url = '/swagger.json'
status = 200, kwargs = {'base_url': 'http://api.restx.org'}
response = <WrapperTestResponse streamed [404 NOT FOUND]>, @py_assert1 = 404
@py_assert3 = False
@py_format5 = '404\n{404 = <WrapperTestResponse streamed [404 NOT FOUND]>.status_code\n} == 200'
@py_format7 = 'assert 404\n{404 = <WrapperTestResponse streamed [404 NOT FOUND]>.status_code\n} == 200'

    def get_json(self, url, status=200, **kwargs):
        response = self.get(url, **kwargs)
>       assert response.status_code == status
E       assert 404 == 200
E        +  where 404 = <WrapperTestResponse streamed [404 NOT FOUND]>.status_code

tests/conftest.py:25: AssertionError

Environment

  • python==3.12.7
  • flask==3.1.0
  • flask-restx==1.3.0
  • pytest-flask==1.3.0

Additional information

The regression encountered just after updating to flask==3.1.0, no other packages updated.

@ancieg ancieg added the bug Something isn't working label Nov 15, 2024
@rolypolybunz
Copy link

rolypolybunz commented Nov 25, 2024

@ancieg Was the restx library pulled from Github releases or from the public pypi (FYI I raised a query similar to this: #627)

@ancieg
Copy link
Author

ancieg commented Nov 25, 2024

@ancieg Was the restx library pulled from Github releases or from the public pypi (FYI I raised a query similar to this: #627)

From ALT Sisyphus repository: https://ftp.altlinux.org/pub/distributions/ALTLinux/Sisyphus/noarch/RPMS.classic/python3-module-flask-restx-1.3.0-alt1.noarch.rpm

RPM spec-file: https://packages.altlinux.org/en/sisyphus/srpms/python3-module-flask-restx/specfiles/

@peter-doggart
Copy link
Contributor

This is now fixed in main, will get it released soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants