-
Notifications
You must be signed in to change notification settings - Fork 685
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
Use new network simulator library in tests #1099
Use new network simulator library in tests #1099
Conversation
tangentially related: #1100 |
setup.py
Outdated
@@ -50,7 +50,7 @@ | |||
"pytest-xdist==1.18.1", | |||
"pytest-watch>=4.1.0,<5", | |||
# only needed for p2p | |||
"pytest-asyncio-network-simulator==0.1.0a1", | |||
"pytest-asyncio-network-simulator==0.1.0a1;python_version>='3.6'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this syntax mean: Only install this if we are in a python 3.6 environment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, fancy-pants setup tools wizardy. Slight correction: it means "only if we're in >= Python 3.6
"
tests/p2p/conftest.py
Outdated
@@ -30,3 +33,10 @@ def p2p_logger(): | |||
|
|||
return logger | |||
""" | |||
|
|||
|
|||
@pytest.fixture |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably an autouse=True
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it hilarious that I forgot that. Think I'll add a small test that verifies that asyncio is indeed patched.
99cecc1
to
b613297
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
What was wrong?
Some of our
p2p
tests use real networking.How was it fixed?
Change to use the new library
pytest-asyncio-network-simulator
which mocks out the networking.Cute Animal Picture