#33454: Django4 does not pick up tests according to tags.
-----------------------------------+--------------------------------------
Reporter: Thorben Luepkes | Owner: nobody
Type: Bug | Status: closed
Component: Testing framework | Version: 4.0
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Comment (by Mariusz Felisiak):
Replying to [comment:8 Thorben Luepkes]:
> Could you please take a look at
https://github.com/Thorbenl/django4-testrunner again?
As [https://docs.djangoproject.com/en/stable/topics/testing/overview
/#running-tests documented]: ''"Test discovery is based on the unittest
module’s built-in test discovery. By default, this **will discover tests
in any file named “test*.py” under the current working directory.**"'' You
can pass a test label to ignore a specific market, e.g.
{{{
./manage.py test market_a_app --tag=market_a --timing --keepdb --verbosity
2
./manage.py test market_b_app --tag=market_b --timing --keepdb --verbosity
2
}}}
or you can use conditional imports:
{{{#!python
if settings.MARKET == MARKET_A:
from .models import AdvertisementIdMapping
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33454#comment:9>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.158394a7cb4e1a4f7486cf06c878ce0b%40djangoproject.com.