Skip to content

migrates test_warnings.py from testdir to pytester #8104

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
Dec 13, 2020

Conversation

bot2x
Copy link
Contributor

@bot2x bot2x commented Dec 6, 2020

No description provided.

Copy link
Member

@bluetech bluetech left a comment

Choose a reason for hiding this comment

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

Thanks @bot2x, looks good to me!

One thing that would also be nice, while we're at it, is to add -> None to the test functions. I made one suggestion in the GitHub review but it also applies to the other places.

The reason for adding -> None is that without it mypy still considers the type annotations to be partial.

But it's also good without it, let me know if you can't get to it.

@@ -39,9 +39,9 @@ def foo():


@pytest.mark.filterwarnings("default")
def test_normal_flow(testdir, pyfile_with_warnings):
def test_normal_flow(pytester: Pytester, pyfile_with_warnings):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def test_normal_flow(pytester: Pytester, pyfile_with_warnings):
def test_normal_flow(pytester: Pytester, pyfile_with_warnings) -> None:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Understood. This is to be added to all the function which don't return anything for the completeness. I'll update the pr.

Copy link
Member

@bluetech bluetech left a comment

Choose a reason for hiding this comment

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

Thanks @bot2x!

@bluetech bluetech merged commit fa784e1 into pytest-dev:master Dec 13, 2020
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