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

mark fixtures #2872

Closed
gaborbernat opened this Issue Oct 26, 2017 · 12 comments

Comments

Projects
None yet
4 participants
@gaborbernat
Copy link

commented Oct 26, 2017

Is it possible to mark a fixture? E.g. if I have a slow fixture, can I mark the fixture as slow, which then would propagate to mark all tests using that fixture as slow. How hard is to achieve this? Thanks!

@RonnyPfannschmidt

This comment has been minimized.

Copy link
Member

commented Oct 26, 2017

this is currently not implemented and currently impossible to correctly implement due to massive issues in the mark system

@gaborbernat

This comment has been minimized.

Copy link
Author

commented Oct 26, 2017

then is there a mark system refactor in plan? 👍

@RonnyPfannschmidt

This comment has been minimized.

Copy link
Member

commented Oct 26, 2017

yes - there was a ml thread, an the next step is killing old style marker transfer in favour of nodes owning their marks

however this still doesnt solve the fixture case as we would need to collect the complete fixture dependency/override graph and all marks within it in order to pass the data along

in addition markers like parametrize would be a pain if they where passed around that way

on top of that fixture params expansion may bring in marks that are passed in already

@gaborbernat

This comment has been minimized.

Copy link
Author

commented Oct 26, 2017

is there a place we can follow the progress of this beside the mailing list?

@RonnyPfannschmidt

This comment has been minimized.

Copy link
Member

commented Oct 26, 2017

there is a project about sorting the mark issues out here in the issue tracker

@gaborbernat

This comment has been minimized.

Copy link
Author

commented Jul 18, 2018

@RonnyPfannschmidt @nicoddemus we the revamp of the fixtures is now possible to achieve this?

@Zac-HD

This comment has been minimized.

Copy link
Member

commented Oct 21, 2018

Per #3664, we have decided not to support marks on fixtures, and make this into an explicit error.

@Zac-HD Zac-HD closed this Oct 21, 2018

@gaborbernat

This comment has been minimized.

Copy link
Author

commented Oct 21, 2018

I don't see any explanation why this is the case 🤔 is this a bad practice?

@RonnyPfannschmidt

This comment has been minimized.

Copy link
Member

commented Oct 21, 2018

IIts simply an utter hell when matching various use-cases, not doing something incredible hhard and error prone is vital for the sustenance of a volunteer driven project

@gaborbernat

This comment has been minimized.

Copy link
Author

commented Oct 21, 2018

I guess here lies my limitation, don't know how hard it is. In my mind is just interating over all tests and all which have a fixture get a mark. This could be a final phase at the end of test collection.

@RonnyPfannschmidt

This comment has been minimized.

Copy link
Member

commented Oct 21, 2018

Its technically impossible to do it correctly withe the current structure oof the fixture system

@nicoddemus

This comment has been minimized.

Copy link
Member

commented Oct 21, 2018

Just to add to @RonnyPfannschmidt's response: after collection, pytest doesn't have a map of which fixtures are used by which tests, fixtures are created lazily during test setup or even inside tests themselves using request.getfixturevalue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.