Comments (9)
I managed to intercept the test function for each unittest. I can obtain measures which seems fine.
I am actually a bit stuck for reporting these measures since I have no access to the session. I tried to use hook reports, but I am unsuccessful so far.
I have other ideas to manage my way through the unittest protocol but it seems hacky.
Keep you posted.
from pytest-monitor.
Thanks for the suggestion.
As stated in the PR #38 I need to understand both sequence and objects that lies beneath. I'll put details about that here for clarity's sake.
from pytest-monitor.
As discussed here #38
pytest
almost fully supportsunittest
, but currentlypytest-monitor
skips allunittest
-based tests.I originally proposed to document this, but it was suggested that perhaps this can be fixed and
pytest-monitor
could supportunittest
-based tests too, which would be awesome.So as suggested opening this Issue to track the feasibility/progress on this front.
Will be waiting for unittest support ;)
from pytest-monitor.
Hello
I've been more busy than expected but I have been able to made some progress.
It does not seem feasible to "inject" the probing system of pytest-monitor for unittest function/classes (The probe relies on Generic Test item with standard testing protocol).
However, I've found an interesting way of injection that seems promising. I'll try to dig in the next days.
from pytest-monitor.
Dear @js-dieu,
thank you for the great plugin! Would you mind to share your progress in a branch? This feature would help me a lot and maybe I can help with the progress.
Regards
Roman
from pytest-monitor.
Follow up: It is working here outside of the pytest-monitor:
https://github.com/ChaoticRoman/pytest-monitor-example/blob/custom_memory_profiler/unittestit.py
from pytest-monitor.
Hello @ChaoticRoman
I unfortunately lost the development after entering an erroneous command. That being said, I might be able to recode what I did, though your snippet is neat for starting it again. Keep you posted!
from pytest-monitor.
Bloomberg guys just released this: https://github.com/bloomberg/memray
Will check it out and let you know.
from pytest-monitor.
Memray and pytest-memray looks cool but have this exactly same issue, reported: bloomberg/pytest-memray#6
from pytest-monitor.
Related Issues (20)
- Provide an option to force garbage collector to run between tests HOT 2
- discuss best memory measurement approach and possible leak detection
- Backend realization HOT 2
- Unable to send measures on monitor-server
- Write monitor-output of tests to console HOT 6
- Incorrect result HOT 6
- pytest.skip() in a fixture causes an AttributeError for monitor_results during teardown HOT 5
- creating/binding a socket in a fixture causes it to not close HOT 6
- unicode issue in determine_scm_revision with Perforce
- Crash on __init__ if psutil.cpu_freq() gives no results HOT 1
- Running pytest after install pytest-monitor results in `FileNotFoundError: [Errno 2] No such file or directory (originated from sysctl(HW_CPU_FREQ))` HOT 6
- NotImplementedError: can't find current frequency file HOT 4
- Support for newer python versions HOT 1
- Missing metrics for failed tests HOT 8
- Drop python 3.7/pytest 5.*
- Use black and flake8 with pre-commit hooks
- Add Bitbucket CI details to
- Add postgres DB handler
- --no-monitor breaks pytest.raises and django_assert_num_queries HOT 2
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-monitor.