(cls)
| 745 | |
| 746 | |
| 747 | def _do_skips(cls): |
| 748 | reasons = [] |
| 749 | all_configs = _possible_configs_for_cls(cls, reasons) |
| 750 | |
| 751 | if getattr(cls, "__skip_if__", False): |
| 752 | for c in getattr(cls, "__skip_if__"): |
| 753 | if c(): |
| 754 | config.skip_test( |
| 755 | "'%s' skipped by %s" % (cls.__name__, c.__name__) |
| 756 | ) |
| 757 | |
| 758 | if not all_configs: |
| 759 | msg = "'%s.%s' unsupported on any DB implementation %s%s" % ( |
| 760 | cls.__module__, |
| 761 | cls.__name__, |
| 762 | ", ".join( |
| 763 | "'%s(%s)+%s'" |
| 764 | % ( |
| 765 | config_obj.db.name, |
| 766 | ".".join( |
| 767 | str(dig) |
| 768 | for dig in exclusions._server_version(config_obj.db) |
| 769 | ), |
| 770 | config_obj.db.driver, |
| 771 | ) |
| 772 | for config_obj in config.Config.all_configs() |
| 773 | ), |
| 774 | ", ".join(reasons), |
| 775 | ) |
| 776 | config.skip_test(msg) |
| 777 | elif hasattr(cls, "__prefer_backends__"): |
| 778 | non_preferred = set() |
| 779 | spec = exclusions.db_spec(*util.to_list(cls.__prefer_backends__)) |
| 780 | for config_obj in all_configs: |
| 781 | if not spec(config_obj): |
| 782 | non_preferred.add(config_obj) |
| 783 | if all_configs.difference(non_preferred): |
| 784 | all_configs.difference_update(non_preferred) |
| 785 | |
| 786 | if config._current not in all_configs: |
| 787 | _setup_config(all_configs.pop(), cls) |
| 788 | |
| 789 | |
| 790 | def _setup_config(config_obj, ctx): |
no test coverage detected