Giter VIP home page Giter VIP logo

Comments (6)

smarie avatar smarie commented on May 31, 2024 1

Fixed in 1.7.0 (to be released in a few minutes)

from python-pytest-steps.

smarie avatar smarie commented on May 31, 2024

It would be non-trivial to fix this: indeed the way we currently generate the wrappers around test functions is done with a hacked version of decorator to add arguments in the signature, and the only way I found as of today is to prepend the new arguments at the beginning of the positional arguments in the new signature.

When a function is located inside a class, its first argument is 'self' or 'cls', and should remain the first argument, even after our wrapping.

We could however inspect the test functions and detect that it is an instance, class or static method, so that we handle the case specifically.

Let's wait for users actually requiring it :)

from python-pytest-steps.

rplevka avatar rplevka commented on May 31, 2024

uhm...here i am :D

from python-pytest-steps.

smarie avatar smarie commented on May 31, 2024

Thanks for caring! As of today as I wrote above, this would require a major non-trivial modification.

A workaround is to use the "new" pytest style (i.e. no classes, just plain old functions in separate modules). But I understand that in large projects this might not be satisfying.

I would gladly accept contributions on the topic if anyone feels ready to dig into dynamic code compilation.

from python-pytest-steps.

zeburek avatar zeburek commented on May 31, 2024

Looks like a MUSTHAVE feature

from python-pytest-steps.

smarie avatar smarie commented on May 31, 2024

It seems that this is doable quite easily with current status of the code (now that I rely on makefun do manipulate the signatures). I'll have a look.

from python-pytest-steps.

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.