Giter VIP home page Giter VIP logo

Comments (4)

csernazs avatar csernazs commented on August 29, 2024 1

Hi @azmeuk ,

This has been published with version 1.0.7 of pytest-httpserver. I'm sorry for the delay, I totally forgot that I merged you PR so there should be a release.

Thanks for your contribution, I promise next time I'll release it quickly.

BR,
Zsolt

from pytest-httpserver.

csernazs avatar csernazs commented on August 29, 2024

Yes, I think that you could implement a new fixture as you suggested, which would listen on a different IP, so you would have two instances running in the same process, in two different threads, but that should not be an issue.

I think you could implement it in a similar way as the make_httpserver function here, with a more simplified API (you won't need flexibility there as it would be only for you).

Alternatively, you could introduce a marker in pytest which would specify the IP protocol (4 or 6) and based on it, you could bind to ipv4 or 6, accordingly. Then you would need to run the tests twice (eg. from a shell script) by specifying either the 4 or the 6 marker.
This is what I did to test TLS, as it is a very similar problem as yours (I wanted to have a TLS server and a non-TLS one). As an example, see the commit e9a3a9d.

from pytest-httpserver.

azmeuk avatar azmeuk commented on August 29, 2024

I managed to build my ad-hoc ipv6 fixtures. Would you accept a PR for a httpserver_ipv6 fixture, or is this out-of-scope for this library?

from pytest-httpserver.

csernazs avatar csernazs commented on August 29, 2024

I thought that this is a marginal issue but you are the second developer dealing with ipv4 vs ipv6 things, and adding a new fixture won't harm anyone (assuming that the original keeps working), so I'm open to accept the PR.

Just I want to understand, the httpserver_ipv6 would be different from the current httpserver one in the default listen address only, right? The ipv6 would listen on ::1 while the ipv4 would still listen on localhost which gets resolved to something by the OS or werkzeug.
And I guess we would need to change the url_for method also, right? Eg. to have http://[::1]:1234/foobar url as the result.

Anyway, if you submit the PR we can discuss it there.

from pytest-httpserver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.