The feature seems to be coming from the `py.test` project feature
[https://docs.pytest.org/en/latest/usage.html#specifying-tests-selecting-
tests running tests by keyword expression]. The feature is also available
in other testing frameworks, such as `PHPUnit`'s
[https://phpunit.de/manual/6.5/en/textui.html --filter] option.
Adding a similar feature to Django would facilitate test selection. Since
`-k` is already the short-hand for `--keepdb`, it may make more sense to
implement another flag, maybe `--filter`?
--
Ticket URL: <https://code.djangoproject.com/ticket/30245>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by François Freitag):
[https://github.com/django/django/pull/11067 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/30245#comment:1>
* stage: Unreviewed => Accepted
Comment:
Hi François. Yes, this seems a good addition to me.
> ... `-k` is already the short-hand for ...
My initial thought here would be to ''re-take'' `-k` to match `unittest`.
I'm pretty sure us having contrary flags is just going to be a royal-pain
forever.
A small-BC change there is preferably.
"We're adding `-k` to mean ... following `unittest`. Use long `--keepdb`
flag instead." — but maybe people want a short flag too. (???)
I guess we need to ask on the DevelopersMailingList. Can I ask you to post
there to begin the discussion? (I can do it if you don't have a moment.)
Thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/30245#comment:2>
Comment (by François Freitag):
Hi Carlton,
Thank you for looking into this ticket. I'll present the case to the
mailing list today or tomorrow.
Cheers,
--
Ticket URL: <https://code.djangoproject.com/ticket/30245#comment:3>
* needs_better_patch: 0 => 1
Comment:
Marking "Patch needs improvement" until we hear back from the mailing list
discussion.
--
Ticket URL: <https://code.djangoproject.com/ticket/30245#comment:4>
Comment (by François Freitag):
Mailing list thread: https://groups.google.com/forum/#!topic/django-
developers/6NcMRULpBYw
--
Ticket URL: <https://code.djangoproject.com/ticket/30245#comment:5>
* needs_better_patch: 1 => 0
Comment:
Following mailing list consensus to remove the `-k` shorthand for
`--keepdb` without replacement, the
[https://github.com/django/django/pull/11067 PR] has been updated and uses
`-k` to select tests.
--
Ticket URL: <https://code.djangoproject.com/ticket/30245#comment:6>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/30245#comment:7>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"568eed9e79470b9ddf3e1b3bbad9123ada45eae8" 568eed9]:
{{{
#!CommitTicketReference repository=""
revision="568eed9e79470b9ddf3e1b3bbad9123ada45eae8"
Fixed #30245 -- Added -k option to DiscoverRunner.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30245#comment:8>