Skip to content

Commit bf25c4c

Browse files
committed
Added dummy tests to make sure importing continues to work fine
1 parent d9b02c4 commit bf25c4c

21 files changed

Lines changed: 144 additions & 0 deletions

.coveragerc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[run]
2+
omit =
3+
*/__main__.py
4+
tests/*
5+
__init__.py

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
.tox
22
*.sublime-package
3+
pytest
4+
.coverage

__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Docblockr Python."""

tests/.env

Whitespace-only changes.

tests/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Docblockr Python Unit Tests."""

tests/conftest.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
from unittest.mock import MagicMock, patch
2+
import pytest
3+
4+
5+
@pytest.fixture(autouse=True)
6+
def sublime(request):
7+
mock = MagicMock()
8+
patcher = patch.dict('sys.modules', {
9+
'sublime': mock,
10+
})
11+
patcher.start()
12+
request.addfinalizer(patcher.stop)
13+
14+
return mock
15+
16+
17+
@pytest.fixture(autouse=True)
18+
def sublime_plugin(request):
19+
mock = MagicMock()
20+
patcher = patch.dict('sys.modules', {
21+
'sublime_plugin': mock,
22+
})
23+
patcher.start()
24+
request.addfinalizer(patcher.stop)
25+
26+
return mock
27+
28+
29+
@pytest.fixture()
30+
def root_commands():
31+
from .. import commands
32+
return commands
33+
34+
35+
@pytest.fixture()
36+
def root_DocblockrPython():
37+
from .. import DocblockrPython
38+
return DocblockrPython

tests/formatters/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Docblockr Python Unit Tests -- Formatters."""

tests/formatters/conftest.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import pytest
2+
3+
4+
@pytest.fixture()
5+
def formatter_base():
6+
from formatters import base
7+
return base
8+
9+
10+
@pytest.fixture()
11+
def formatter_docblock():
12+
from formatters import docblock
13+
return docblock
14+
15+
16+
@pytest.fixture()
17+
def formatter_google():
18+
from formatters import google
19+
return google
20+
21+
22+
@pytest.fixture()
23+
def formatter_numpy():
24+
from formatters import numpy
25+
return numpy
26+
27+
28+
@pytest.fixture()
29+
def formatter_PEP0257():
30+
from formatters import PEP0257
31+
return PEP0257
32+
33+
34+
@pytest.fixture()
35+
def formatter_registry():
36+
from formatters import registry
37+
return registry
38+
39+
40+
@pytest.fixture()
41+
def formatter_sphinx():
42+
from formatters import sphinx
43+
return sphinx
44+
45+
46+
@pytest.fixture()
47+
def formatter_utils():
48+
from formatters import utils
49+
return utils

tests/formatters/test_PEP0257.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test_exists(formatter_PEP0257):
2+
assert formatter_PEP0257

tests/formatters/test_base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test_exists(formatter_base):
2+
assert formatter_base

0 commit comments

Comments
 (0)