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

Allow registering marks using regex #5570

Open
lhupfeldt opened this issue Jul 7, 2019 · 8 comments
Open

Allow registering marks using regex #5570

lhupfeldt opened this issue Jul 7, 2019 · 8 comments
Labels
topic: marks related to marks, either the general marks or builtin type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature

Comments

@lhupfeldt
Copy link

Because of integration with a test management/reporting system we have a lot of generated marks consisting of a prefix and a number. I'm submitting a pull request to allow registering marks using regex (or any object with a match() method)

@Zac-HD Zac-HD added topic: marks related to marks, either the general marks or builtin type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature labels Jul 9, 2019
@asottile
Copy link
Member

closing for now given the resolution in #5571

@RonnyPfannschmidt
Copy link
Member

RonnyPfannschmidt commented Jul 11, 2019

reopening as this is a detail the next iteration of marker registration should take into account
@lhupfeldt would it be a option to pass the number as first argument to a mark instead

aka mark.FOO(123) instead of mark.FOO_123

@lhupfeldt
Copy link
Author

lhupfeldt commented Jul 11, 2019 via email

@RonnyPfannschmidt
Copy link
Member

@lhupfeldt to me it seems that mapping between FOO(x) and FOO_x might be trivial,

is there anything preventing you from mapping the test tools FOO_x to Foo(x) ?

@lhupfeldt
Copy link
Author

lhupfeldt commented Jul 11, 2019 via email

@RonnyPfannschmidt
Copy link
Member

thanks for the input, we can work with that

@pfctdayelise
Copy link
Contributor

I've been thinking about this. Maybe an alternative to fancy ways of registering marks is adding a hook like pytest_validate_mark?

@RonnyPfannschmidt
Copy link
Member

i like that idea, i would like to see of we can get that integrated with ideas for the object based markers that are floating since a while and should solidify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: marks related to marks, either the general marks or builtin type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature
Projects
None yet
Development

No branches or pull requests

5 participants