mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Import std libs at the top
the rationale behind importing under a test function is to import what is being tested, and perhasp likely to fail, to isolate possible errors resulting from the import itself see http://docs.pylonsproject.org/en/latest/community/testing.html#rule-never-import-the-module-under-test-at-test-module-scope for more
This commit is contained in:
parent
f341bd1586
commit
8c1dbc86a0
@ -1,7 +1,8 @@
|
||||
import pytest
|
||||
|
||||
from functools import singledispatch
|
||||
from types import ModuleType
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_module():
|
||||
@ -9,7 +10,6 @@ def mock_module():
|
||||
|
||||
|
||||
def test_module_dispatch_registers(mock_module):
|
||||
from functools import singledispatch
|
||||
from bigchaindb.backend.utils import make_module_dispatch_registrar
|
||||
|
||||
@singledispatch
|
||||
@ -26,7 +26,6 @@ def test_module_dispatch_registers(mock_module):
|
||||
|
||||
|
||||
def test_module_dispatch_dispatches(mock_module):
|
||||
from functools import singledispatch
|
||||
from bigchaindb.backend.utils import make_module_dispatch_registrar
|
||||
|
||||
@singledispatch
|
||||
|
Loading…
x
Reference in New Issue
Block a user