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
Add node switcher #68
Conversation
tests/providers/node/pool_test.py
Outdated
@classmethod | ||
def setup_class(cls): | ||
cls.pool = NodeConnectionPool(nodes=MAINNET_CHAIN) |
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.
It would be better to create new pool for every test, just to make sure starting state for tests is always the same.
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.
Tests go from top to bottom, so I think it's not necessary to duplicate object creation, where the object is not changed and logic is simple.
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.
In no way test should be dependent on other tests, and there is no guarantee to run in order. There are at least 2 situations when this would be an obstacle, first one is when someone tries to make a single test pass, and instead of running this single test after implementing changes in code, he's forced to run whole class of tests. Second one is parallelism, with this approach we are losing part of functionalities from plugins like xdist for pytest, in short, we can't run every test in different process, we are limited to classes per process.
tests/providers/node/pool_test.py
Outdated
@classmethod | ||
def setup_class(cls): | ||
cls.pool = NodeConnectionPool(nodes=MAINNET_CHAIN) |
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.
In no way test should be dependent on other tests, and there is no guarantee to run in order. There are at least 2 situations when this would be an obstacle, first one is when someone tries to make a single test pass, and instead of running this single test after implementing changes in code, he's forced to run whole class of tests. Second one is parallelism, with this approach we are losing part of functionalities from plugins like xdist for pytest, in short, we can't run every test in different process, we are limited to classes per process.
Web3ConnectionException
toNodeConnectionException
tests
directory structure