Runs the tests in a TestCase against a single source of time zone data. unittest.TestCase subclasses can't use parametrized pytest fixtures, so to run a set of tests against more than one source, subclass the test case and override ``tz_source``. A ``tz_source`` of None leaves everythin
| 103 | |
| 104 | |
| 105 | class TzSourceMixin: |
| 106 | """Runs the tests in a TestCase against a single source of time zone data. |
| 107 | |
| 108 | unittest.TestCase subclasses can't use parametrized pytest fixtures, so to |
| 109 | run a set of tests against more than one source, subclass the test case |
| 110 | and override ``tz_source``. A ``tz_source`` of None leaves everything as |
| 111 | it is. |
| 112 | """ |
| 113 | |
| 114 | tz_source = "tzpath" |
| 115 | |
| 116 | def setUp(self): |
| 117 | super().setUp() |
| 118 | if self.tz_source is None: |
| 119 | return |
| 120 | |
| 121 | reason = tz_source_skip_reason(self.tz_source) |
| 122 | if reason is not None: |
| 123 | self.skipTest(reason) |
| 124 | |
| 125 | context = tz_source_context(self.tz_source) |
| 126 | context.__enter__() |
| 127 | self.addCleanup(context.__exit__, None, None, None) |
| 128 | |
| 129 | |
| 130 | class PicklableMixin: |
nothing calls this directly
no outgoing calls
no test coverage detected