bloomberg / memray

Memray is a memory profiler for Python
https://bloomberg.github.io/memray/
Apache License 2.0
13.17k stars 392 forks source link

Prevent the test suite from rendering Textual apps to the screen while running #600

Closed godlygeek closed 4 months ago

godlygeek commented 4 months ago

When running make check or make pycoverage, some of the tests in test_main.py cause Textual TUIs to be rendered to the screen.

The graphical output of these tests should be suppressed, so that only the pytest output appears, even when running with -s. (We may want to reconsider running with -s by default, too, but the current behavior is wrong and should be fixed, anyway.)

terapyon commented 4 months ago

I tried two command. I looked below.

make chack
screenshot-chack2024-05-20 12 26 53
make pycoverage
screenshot-pycoverage2024-05-20 12 29 19

No need to show Memray GUI, We want to show only pytest text.

terapyon commented 4 months ago

I used pytest.mark.skip to investigate the scope of impact. When I disabled all the methods in class TestTreeSubCommand and TestLiveRemoteSubcommand, the issue stopped appearing. It seems that these classes affect the tree and remote, live-remote switches.

https://github.com/bloomberg/memray/blob/main/tests/integration/test_main.py

vitorespindola commented 4 months ago

I wiil take a look on it

sarahmonod commented 4 months ago

Thank you @terapyon for the preliminary research! Vitore will now take a look