Skip to content

Make fixture generic to enable type hinting - #4770

Merged
pekkaklarck merged 4 commits into
robotframework:masterfrom
Serhiy1:dev/type-hinting
May 23, 2023
Merged

pekkaklarck merged 4 commits into
robotframework:masterfrom
Serhiy1:dev/type-hinting

Conversation

@Serhiy1

@Serhiy1 Serhiy1 commented May 22, 2023

Copy link
Copy Markdown
Contributor

create_fixture takes a fixture class parameter, making the function generic.

Unit tests have also been updated to reflect this

@Serhiy1
Serhiy1 force-pushed the dev/type-hinting branch 3 times, most recently from 84dfb43 to 910e851 Compare May 23, 2023 08:03
@Serhiy1
Serhiy1 force-pushed the dev/type-hinting branch from 910e851 to 412aff9 Compare May 23, 2023 08:53
Comment thread src/robot/result/model.py Outdated
if self._teardown is None:
self._teardown = create_fixture(self.__class__, None, self, self.TEARDOWN)
# Would be better to enhance `create_fixture` so that its return
# type would match argument type.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The above comment is now redundant. 🎉

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I try to remove by modifying this PR using the web interface....

@pekkaklarck pekkaklarck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great work! I removed an outdated comment and updated create_fixture docstring via the web interface.

@pekkaklarck
pekkaklarck merged commit b83307a into robotframework:master May 23, 2023
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