Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

SilverBzH
Copy link
Collaborator

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.

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.
@SilverBzH SilverBzH requested a review from uael July 19, 2023 00:21
@@ -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())
Copy link
Contributor

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

Copy link
Collaborator Author

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())
Copy link
Contributor

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())
Copy link
Contributor

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
Copy link
Contributor

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 ?

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