GithubHelp home page GithubHelp logo

Comments (4)

kwshi avatar kwshi commented on June 1, 2024 1

@miketheman oops, sorry--life errands came up & this briefly fell off my radar. I've now made the modification & pushed; I believe it should be ready to merge now.

from pytest-socket.

miketheman avatar miketheman commented on June 1, 2024

Hi @kwshi ! Thanks for the in-depth details here. I'll attempt to address a couple of these:

Fixes section

  • requests is used in some of the tests but not specified as a test/dev dependency. Installing requests fixes one of the issues.

requests comes along from the starlette package's extras, as seen here: https://github.com/encode/starlette/blob/e45c5793611bfec606cd9c5d56887ddc67f77c38/setup.py#L52

I've never had to directly express that dependency for the tests, as it comes along automatically from poetry - not 100% certain how yet, but it works 🎉
If you'd have to set other test dependencies like starlette on your test setup, adding requests there ought to solve the issue.

Several of the source files have lines that are too long & other formatting errors...

Looks like the flake8 config file isn't included in the dist package either - as it sets the limit to 160 chars.

The E122 error is triggered on the generated setup.py file - so that'd be an issue to raise with Poetry, not this project.

I'm also thinking that adding the flake8 flag to pytest is better for those that modify the code (against this repo) vs a package maintainer that is less likely to modify the code, rather only test it? I'm undecided here.

Side notes section

For both items -

One of the benefits of using something like poetry is that I can get a virtual environment, install the package into the current python scope, use pytest cli directly, as now the PYTHONPATH does not need to be changed to try and find the package.
I can then dispose of the virtualenv at will.

Most of the routine testing is also performed via GitHub Actions, which is ephemeral and I don't mind if the package is installed, as the entire environment goes away at the end of the test.

from pytest-socket.

kwshi avatar kwshi commented on June 1, 2024

Ah I see! Thanks for the thorough response--

If you'd have to set other test dependencies like starlette on your test setup, adding requests there ought to solve the issue.

Interesting--I wasn't testing using Poetry, so that explains the difference. Indeed, I was just wondering whether starlette should be added to the list of dev/test dependencies in pyproject.toml, but it sounds like that's not actually necessary.

Looks like the flake8 config file isn't included in the dist package either - as it sets the limit to 160 chars.

Cool, I'll amend my PR to add this.

The E122 error is triggered on the generated setup.py file - so that'd be an issue to raise with Poetry, not this project.

Makes sense!

Most of the routine testing is also performed via GitHub Actions, which is ephemeral and I don't mind if the package is installed, as the entire environment goes away at the end of the test.

I see. Well, for future reference for others who wish to try to run tests without installation or poetry (e.g. other people trying to make this into a package), the way to do so would be to

  1. python setup.py egg_info to generate metadata to help pytest detect it as a plugin;
  2. python -m pytest to run pytest with the correct PYTHONPATH detection.

from pytest-socket.

miketheman avatar miketheman commented on June 1, 2024

Looks like the flake8 config file isn't included in the dist package either - as it sets the limit to 160 chars.

Cool, I'll amend my PR to add this.

@kwshi I don't think the PR has been amended, and I was waiting for that to be added before merging. Is that something you still wish to pursue?

from pytest-socket.

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.