Skip to content

Fix running st2client unit tests under pytest #5690

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 4 commits into from
Aug 3, 2022
Merged

Conversation

cognifloyd
Copy link
Member

@cognifloyd cognifloyd commented Jul 29, 2022

Background

I'm working towards introducing pants. Eventually I would like to use pants to run tests to take advantage of the fine-grained per-file caching of results that accounts for dependencies by python files (pants infers the deps by reading the python files). But, pants uses pytest to run tests not nosetest.

This is another of several PRs that improves our compatibility with pytest. Others include: #5686, #5689, #5691

Note: I do not have pytest support completely ironed out, but this is a step in that direction. Don't expect running all our tests with pytest to work yet.

Overview

Capturing console output uses capsys under pytest.
So modify our homegrown console redirection so that it uses capsys when running under pytest.

Capturing console output uses `capsys` under pytest.
So modify our homegrown console redirection so that it uses
capsys when running under pytest.
@cognifloyd cognifloyd added this to the 3.8.0 milestone Jul 29, 2022
@cognifloyd cognifloyd added no changelog No Changelog.rst needed for this PR refactor tests labels Jul 29, 2022
@cognifloyd cognifloyd self-assigned this Jul 29, 2022
@pull-request-size pull-request-size bot added the size/M PR that changes 30-99 lines. Good size to review. label Jul 29, 2022
@cognifloyd cognifloyd requested a review from a team July 29, 2022 00:51
Copy link
Contributor

@amanda11 amanda11 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@arm4b arm4b left a comment

Choose a reason for hiding this comment

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

👍

@cognifloyd cognifloyd enabled auto-merge (squash) August 3, 2022 21:10
@cognifloyd cognifloyd merged commit 7ac88f3 into master Aug 3, 2022
@cognifloyd cognifloyd deleted the pytest-capsys branch August 3, 2022 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog No Changelog.rst needed for this PR pantsbuild refactor size/M PR that changes 30-99 lines. Good size to review. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy