Opened 9 months ago

Closed 9 months ago

Last modified 9 months ago

#35184 closed New feature (wontfix)

tests - use wildcards in labels

Reported by: אורי Owned by: nobody
Component: Testing framework Version:
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I want to add wildcards to test labels. For example, if I have tests at speedy.core.accounts.tests.test_views, and also speedy.net.accounts.tests.test_views and speedy.match.accounts.tests.test_views, I want to specify all of them with a wildcard - something like speedy.*.accounts.tests.test_views. Or even *.test_views which will include all the test_views files in my project. And also *.test_v* which will be all the files that start with test_v. This should be similar to wildcards in bash and in operating systems. Is it possible to add such a feature?

Change History (3)

comment:1 by David Sanders, 9 months ago

Resolution: wontfix
Status: newclosed

Hi,

Thanks for the suggestion though 2 things:

  • feature requests must be submitted to the Django Forum first; and
  • check out pytest (with pytest-django plugin) because it has the ability to specify file paths & run specifc tests by keyword. Perhaps this suits your needs?

comment:2 by Baptiste Mispelon, 9 months ago

I'll also note that it's already possible to pass wildcards to the -k option: https://docs.djangoproject.com/en/5.0/ref/django-admin/#cmdoption-test-k (see also Python's official doc https://docs.python.org/3/library/unittest.html#cmdoption-unittest-k)

in reply to:  2 comment:3 by אורי, 9 months ago

Replying to Baptiste Mispelon:

I'll also note that it's already possible to pass wildcards to the -k option: https://docs.djangoproject.com/en/5.0/ref/django-admin/#cmdoption-test-k (see also Python's official doc https://docs.python.org/3/library/unittest.html#cmdoption-unittest-k)

Thank you, I was not aware of the -k option!

Note: See TracTickets for help on using tickets.
Back to Top