Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot show progress bar when using pytest in pycharm #732

Open
jiahao-shen opened this issue May 7, 2019 · 1 comment
Open

Cannot show progress bar when using pytest in pycharm #732

jiahao-shen opened this issue May 7, 2019 · 1 comment
Assignees
Labels
invalid ⛔ Not-an-issue or upstream (not-our-issue) question/docs ‽ Documentation clarification candidate

Comments

@jiahao-shen
Copy link

jiahao-shen commented May 7, 2019

When i run the following code with pytest in pycharm, the progress bar didn't show in real time.

from tqdm import trange
from time import sleep


def test_1():
    for _ in trange(100):
        sleep(0.03)

It showed after finished running, like this.
屏幕快照 2019-05-07 21 22 43

But if i run the code like this, the progress bar shows.

from tqdm import trange
from time import sleep
import logging

logging.basicConfig(level=logging.DEBUG)


def test_1():
    for _ in trange(100):
        logging.debug('')
        sleep(0.03)

屏幕快照 2019-05-07 21 22 27

I really don't know how to fix it.

@jiahao-shen jiahao-shen reopened this May 7, 2019
@jiahao-shen jiahao-shen changed the title Pytest Cannot show progress bar when using pytest in pycharm May 7, 2019
@casperdcl
Copy link
Sponsor Member

interesting - seems flush() is ignored and flushing only occurs when \n is printed. Seems to be an upstream PyCharm issue

@casperdcl casperdcl self-assigned this May 9, 2019
@casperdcl casperdcl added invalid ⛔ Not-an-issue or upstream (not-our-issue) question/docs ‽ Documentation clarification candidate labels May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid ⛔ Not-an-issue or upstream (not-our-issue) question/docs ‽ Documentation clarification candidate
Projects
None yet
Development

No branches or pull requests

2 participants