-
Notifications
You must be signed in to change notification settings - Fork 11
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
move reset from setup to teardown #33
base: main
Are you sure you want to change the base?
Conversation
The reset is currently being done in the setup_test hence it is executed for each tests even if the test is skipped. Doing the reset on the teardown let us skip the reset when it is not desired such as after a skipped test. This reduce considerably the overall time for the tests execution.
@@ -51,13 +52,16 @@ def setup_class(self) -> None: | |||
if isinstance(device, BumblePandoraDevice): | |||
device.config.setdefault('classic_enabled', True) | |||
|
|||
await asyncio.gather(self.dut.reset(), self.ref.reset()) |
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.
Reset on setup class isnt necessary
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.
If we don't have a reset on the setup_class, then if the test is skipped and there is only one test then it's gonna hang for ever on the Pandora apk shutdown. Maybe we can do the reset in the teardown in the case we have only one test and it is skipped. What do you think ?
@@ -60,13 +61,16 @@ def setup_class(self) -> None: | |||
if isinstance(device, BumblePandoraDevice): | |||
device.config.setdefault('classic_enabled', True) | |||
|
|||
await asyncio.gather(self.dut.reset(), self.ref.reset()) |
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.
Same as above
@@ -46,13 +47,16 @@ def setup_class(self) -> None: | |||
if isinstance(device, BumblePandoraDevice): | |||
device.config.setdefault('classic_enabled', True) | |||
|
|||
await asyncio.gather(self.dut.reset(), self.ref.reset()) |
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.
Same as above
@@ -65,6 +65,11 @@ def teardown_class(self) -> None: | |||
if self.devices: | |||
self.devices.stop_all() | |||
|
|||
@avatar.asynchronous |
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.
Can you remove the reset on setup_class
as well ?
The reset is currently being done in the setup_test
hence it is executed for each tests even if the test is skipped.
Doing the reset on the teardown let us skip the reset when it is
not desired such as after a skipped test.
This reduce considerably the overall time for the tests execution.