| @@ 142-154 (lines=13) @@ | ||
| 139 | def name_format(request): |
|
| 140 | return request.param |
|
| 141 | ||
| 142 | ||
| 143 | @pytest.fixture |
|
| 144 | def sess(request, name_format): |
|
| 145 | return MockSession(name_format) |
|
| 146 | ||
| 147 | ||
| 148 | def make_logger(sess): |
|
| 149 | output = StringIO() |
|
| 150 | sess.logger = Namespace( |
|
| 151 | warn=lambda code, text, **opts: output.write(u"%s: %s %s\n" % (code, force_text(text), opts)), |
|
| 152 | info=lambda text, **opts: output.write(force_text(text) + u'\n'), |
|
| 153 | error=lambda text: output.write(force_text(text) + u'\n'), |
|
| 154 | ) |
|
| 155 | sess.storage.logger = Namespace( |
|
| 156 | warn=lambda code, text, **opts: output.write(u"%s: %s %s\n" % (code, force_text(text), opts)), |
|
| 157 | info=lambda text, **opts: output.write(force_text(text) + u'\n'), |
|
| @@ 140-152 (lines=13) @@ | ||
| 137 | return text |
|
| 138 | ||
| 139 | ||
| 140 | def make_logger(sess): |
|
| 141 | output = StringIO() |
|
| 142 | sess.logger = Namespace( |
|
| 143 | warn=lambda code, text, **opts: output.write(u"%s: %s %s\n" % (code, force_text(text), opts)), |
|
| 144 | info=lambda text, **opts: output.write(force_text(text) + u'\n'), |
|
| 145 | error=lambda text: output.write(force_text(text) + u'\n'), |
|
| 146 | ) |
|
| 147 | sess.storage.logger = Namespace( |
|
| 148 | warn=lambda code, text, **opts: output.write(u"%s: %s %s\n" % (code, force_text(text), opts)), |
|
| 149 | info=lambda text, **opts: output.write(force_text(text) + u'\n'), |
|
| 150 | error=lambda text: output.write(force_text(text) + u'\n'), |
|
| 151 | ) |
|
| 152 | return output |
|
| 153 | ||
| 154 | ||
| 155 | @pytest.fixture |
|