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

isatty #2550

Merged
merged 13 commits into from
Oct 19, 2019
Merged

isatty #2550

merged 13 commits into from
Oct 19, 2019

Conversation

casperdcl
Copy link
Contributor

@casperdcl casperdcl commented Sep 29, 2019

fixes #2549 non-tty output

  • suppress Tqdm when isatty()
  • fix tests
  • add new test
  • add env var to fake isatty()

@casperdcl casperdcl added enhancement Enhances DVC ui user interface / interaction labels Sep 29, 2019
@casperdcl casperdcl self-assigned this Sep 29, 2019
@casperdcl casperdcl changed the title Isatty isatty Sep 29, 2019
tests/unit/test_progress.py Outdated Show resolved Hide resolved
dvc/progress.py Outdated Show resolved Hide resolved
dvc/progress.py Outdated Show resolved Hide resolved
tests/unit/test_progress.py Outdated Show resolved Hide resolved
dvc/progress.py Outdated Show resolved Hide resolved
dvc/progress.py Outdated Show resolved Hide resolved
tests/__main__.py Outdated Show resolved Hide resolved
dvc/progress.py Outdated Show resolved Hide resolved
tests/unit/test_progress.py Outdated Show resolved Hide resolved
dvc/progress.py Outdated Show resolved Hide resolved
dvc/progress.py Outdated Show resolved Hide resolved
@efiop
Copy link
Contributor

efiop commented Oct 16, 2019

@Suor Please take a look.

dvc/progress.py Outdated Show resolved Hide resolved
tests/__main__.py Outdated Show resolved Hide resolved
dvc/progress.py Outdated Show resolved Hide resolved
dvc/progress.py Outdated Show resolved Hide resolved
Comment on lines 22 to 26
if DVC_ISATTY:
assert "0/10" in out_err.err
else:
assert out_err.err == ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if doesn't make much sense if we only test one of its branches.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may test both depending on env vars when the test is run

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But in conftest.py it's set to True for all tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm yes but I feel this way is more future proof. I don't know what your test framework conventions are so can't really decide. At a minimum I think at least a comment would be required around these lines.

Copy link
Contributor

@efiop efiop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@efiop efiop merged commit 1e01ce3 into iterative:master Oct 19, 2019
@casperdcl casperdcl deleted the isatty branch October 19, 2019 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhances DVC ui user interface / interaction
Projects
None yet
Development

Successfully merging this pull request may close these issues.

suppress progress when isatty
3 participants