Comments (5)
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.
from pytest-testmon.
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.
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.
@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)
- testmon does not respect test order HOT 2
- Ability to run testmon on an installed package HOT 4
- No source package upload to pypi HOT 4
- fails when git is not present HOT 2
- Missing git version tags🤔 HOT 2
- Changes > 1.4.5 made testmon more sensitive to differently packaged environments? HOT 13
- Have a command line that outputs all the tests which reach a certain line in the code HOT 1
- Change to Importlib introduces AttributeError for {d.name} if d.name does not exist. HOT 2
- Temporary files not being cleared inside a container HOT 6
- testmon.org appears to be down HOT 4
- testmon does not work with --branch based coverage HOT 4
- Change to less restrictive license HOT 8
- Seeking examples of pytest-testmon in GitHub Actions HOT 4
- Allow using --testmon-noselect and --testmon-nocollect simultaneously HOT 3
- Mark test as 'run-always'
- Support pytest 8.0
- Support detecting changes in symlinked files HOT 1
- .testmondata does not get flushed at exit HOT 1
- testmon >=2.0.0 does not work with pytest-xdist HOT 1
- INTERNALERROR> TypeError: '<=' not supported between instances of 'int' and 'NoneType' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytest-testmon.