Skip to content

Retry failed dummyserver tests once #1718

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
Oct 29, 2019

Conversation

pquentin
Copy link
Member

Closes #1595

@codecov-io
Copy link

codecov-io commented Oct 29, 2019

Codecov Report

Merging #1718 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1718   +/-   ##
=======================================
  Coverage   99.65%   99.65%           
=======================================
  Files          22       22           
  Lines        2006     2006           
=======================================
  Hits         1999     1999           
  Misses          7        7

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 79e81f9...ec3952f. Read the comment docs.

Copy link
Member

@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

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

Looks good, just one question.

from urllib3 import HTTPConnectionPool
from dummyserver.testcase import SocketDummyServerTestCase

# Retry failed tests
pytestmark = pytest.mark.flaky
Copy link
Member

Choose a reason for hiding this comment

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

I've never seen this construction before, where is it documented? Must it be named pytestmark?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes: http://doc.pytest.org/en/latest/example/markers.html#marking-whole-classes-or-modules

I agree that it's quite obscure, which is why I added the comment. But it's way more convenient than marking every class or every test. Another option is do this for all tests, not only dummyserver tests: we could simply use a command-line option then.

Copy link
Member

Choose a reason for hiding this comment

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

Today I learned! This looks good ready to go then. :)

@sethmlarson sethmlarson merged commit 15e64de into urllib3:master Oct 29, 2019
@pquentin pquentin deleted the retry-flaky-tests branch October 30, 2019 06:53
Dobatymo pushed a commit to Dobatymo/urllib3 that referenced this pull request Mar 16, 2022
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.

Add a pytest retry solution to all dummyserver tests
3 participants