Skip to content

tests: fix for pytest>=4.6.0 caplog #2082

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

Merged
merged 1 commit into from
Jun 3, 2019

Conversation

ei-grad
Copy link
Contributor

@ei-grad ei-grad commented Jun 2, 2019

See pytest-dev/pytest#5312.

New pytest's logging formatter outputs the messages with a pretty indent of newlines in a single message, and this indent appears in caplog.text:

(Pdb) !print(warning)
You are adding a large directory 'large-dir' recursively, consider tracking it as a whole instead.
HINT: Remove the generated stage files and then run dvc add large-dir
(Pdb) !print(self._caplog.text)
...
WARNING  dvc.repo.add:add.py:30 You are adding a large directory 'large-dir' recursively, consider tracking it as a whole instead.
                                HINT: Remove the generated stage files and then run dvc add large-dir
...

So things like "\nsome text\n" in caplog.text are not working anymore.

@ei-grad ei-grad force-pushed the fix-pytest46-caplog branch from 808ac29 to 5fce9a0 Compare June 2, 2019 12:41
@ei-grad ei-grad requested a review from efiop June 2, 2019 13:12
@efiop efiop merged commit 6e70727 into iterative:master Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants