| 17 | | ``` |
| 18 | | python3.9 manage.py test --exclude-tag=functional --timing # Main Market, no functional test |
| 19 | | MARKET=market_b python3.9 manage.py test --tag=market_b --exclude-tag=functional --timing # The other market, also no functional tests |
| 20 | | ``` |
| | 13 | |
| | 14 | |
| | 15 | {{{ |
| | 16 | python3.9 manage.py test --exclude-tag=functional --timing # Main Market, no functional test |
| | 17 | MARKET=market_b python3.9 manage.py test --tag=market_b --exclude-tag=functional --timing # The other market, also no functional tests |
| | 18 | }}} |
| | 19 | |
| | 20 | |
| | 21 | |
| | 22 | Could it maybe have to do with: |
| | 23 | |
| | 24 | |
| | 25 | |
| | 26 | {{{ |
| | 27 | from xmlrunner.extra.djangotestrunner import XMLTestRunner |
| | 28 | |
| | 29 | from.market_settings.markets import MARKET_B |
| | 30 | |
| | 31 | |
| | 32 | class CustomTestSuiteRunner(XMLTestRunner): |
| | 33 | """Custom test runner which excludes market-specific tests by default if no tests are specified.""" |
| | 34 | def build_suite(self, test_labels=None, extra_tests=None, **kwargs): |
| | 35 | if MARKET_BE not in self.tags and not test_labels: |
| | 36 | self.exclude_tags.add(MARKET_B) |
| | 37 | return super().build_suite(test_labels, extra_tests, **kwargs) |
| | 38 | |
| | 39 | def get_resultclass(self): |
| | 40 | if strtobool(os.environ.get("PROFILE_TESTS", "0")): |
| | 41 | return ProfilingTestResult |
| | 42 | else: |
| | 43 | return super().get_resultclass() |
| | 44 | }}} |
| | 45 | |
| | 46 | Printing these tags give me: |
| | 47 | |
| | 48 | {{{ |
| | 49 | Including test tag(s): MARKET_B. |
| | 50 | Excluding test tag(s): functional. |
| | 51 | }}} |