Git Product home page Git Product logo

Comments (5)

tarpas avatar tarpas commented on August 14, 2024 1

Does testmon recursively go through functions called by other functions?
That's the task of the coverage.py which testmon uses. (and I wouldn't call it recursively, the result is a flat list of all executed lines) I feel you'll expect more from coverage + method checksumming than it can actually provide :/

Did you carefully read https://testmon.org/determining-affected-tests ? If there is anything unclear there I would be happy to get questions and try to explain. :)

from pytest-testmon.

tarpas avatar tarpas commented on August 14, 2024

from pytest-testmon.

jacksongoode avatar jacksongoode commented on August 14, 2024

Thanks for the response @tarpas. I think I have the line numbers for each process, but the (helper) functions that a function itself calls are tricky to determine? They are sometimes given by the opcode but not always. Does testmon recursively go through functions called by other functions?

from pytest-testmon.

jacksongoode avatar jacksongoode commented on August 14, 2024

Yes, I did see that - I started digging a bit into process_code.py and (perhaps this is out of scope) but the way I currently see testmon operating is on files where tests are found themselves (through coverage.py). My desire would be to selectively generate a checksum of a function once run (I guess starting coverage before and stopping after).

def a():
    print('hello')

which returns some checksum using a function cov_checksum(a) and find that if I change the function to:

def a():
   print('goodbye')

a helper function compare_checksum(a) would return False indicating that the function has changed since it's last run.

This is sort of my imagined use-case. I recognize that while this is a testing specific implementation, I haven't found any other project that attempts to compare the full execution of a function from one state to another. Do you feel that some of the functions you've written within testmon might be exposed to accomplish this task?

I guess in theory you could make a test:

def test_func_a():
    a()

And then trigger testmon to see if that test needs to be rerun at any given time given potential changes made to a.

from pytest-testmon.

jacksongoode avatar jacksongoode commented on August 14, 2024

@tarpas Just wondering if this would be possible given the constraints of how coverage.py? I'm attempting to de-structure the methods but am running into functions that are decorated upon pytest.

from pytest-testmon.

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.