Converted test_conftest to pytest

This commit is contained in:
Bruno Oliveira 2015-04-04 11:24:48 -03:00
parent 99abd1edeb
commit 6429d29a23
3 changed files with 494 additions and 514 deletions

File diff suppressed because it is too large Load Diff

View File

@ -29,6 +29,7 @@ def app_and_logging(qapp):
and used by all tests.
"""
from log import init
init()
@ -38,4 +39,14 @@ def stubs():
Provides access to stub objects useful for testing.
"""
import stubs
return stubs
@pytest.fixture(scope='session')
def unicode_encode_err():
return UnicodeEncodeError('ascii', # codec
'', # object
0, # start
2, # end
'fake exception') # reason

View File

@ -19,7 +19,6 @@
"""Helpers needed by tests."""
import os
import logging
import contextlib
from unittest import mock
@ -29,13 +28,6 @@ from PyQt5.QtWebKitWidgets import QWebPage
from PyQt5.QtNetwork import QNetworkAccessManager
unicode_encode_err = UnicodeEncodeError('ascii', # codec
'', # object
0, # start
2, # end
'fake exception') # reason
@contextlib.contextmanager
def disable_logger(name):
"""Temporarily disable a logger."""