Skip to content

Commit 67d0572

Browse files
Remove import and rename file to use pytest's conftest.py
Close #3493 see https://docs.pytest.org/en/2.7.3/plugins.html?highlight=re
1 parent 1d4a09b commit 67d0572

File tree

4 files changed

+5
-18
lines changed

4 files changed

+5
-18
lines changed

tests/message/generic_fixtures.py renamed to tests/message/conftest.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22
# For details: https://github.com/PyCQA/pylint/blob/master/COPYING
3+
# pylint: disable=redefined-outer-name
4+
35

46
import pytest
57

@@ -24,7 +26,7 @@ def empty_store():
2426

2527
@pytest.fixture
2628
def store():
27-
store = MessageDefinitionStore()
29+
store_ = MessageDefinitionStore()
2830

2931
class Checker(BaseChecker):
3032
name = "achecker"
@@ -43,8 +45,8 @@ class Checker(BaseChecker):
4345
),
4446
}
4547

46-
store.register_messages_from_checker(Checker())
47-
return store
48+
store_.register_messages_from_checker(Checker())
49+
return store_
4850

4951

5052
@pytest.fixture

tests/message/unittest_message.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33

44
from pylint.message import Message
55

6-
from .generic_fixtures import ( # pylint: disable=unused-import
7-
message_definitions,
8-
store,
9-
)
10-
116

127
def test_new_message(message_definitions):
138
def build_message(message_definition, location_value):

tests/message/unittest_message_definition_store.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
from pylint.exceptions import InvalidMessageError, UnknownMessageError
1111
from pylint.message import MessageDefinition
1212

13-
from .generic_fixtures import empty_store, store # pylint: disable=unused-import
14-
1513

1614
@pytest.mark.parametrize(
1715
"messages,expected",

tests/message/unittest_message_id_store.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
55

66
from pylint.exceptions import InvalidMessageError, UnknownMessageError
77

8-
from .generic_fixtures import ( # pylint: disable=unused-import
9-
empty_msgid_store,
10-
message_definitions,
11-
msgid_store,
12-
msgids,
13-
store,
14-
)
15-
168

179
def test_len_str(msgid_store, msgids):
1810
assert len(msgid_store) == len(msgids)

0 commit comments

Comments
 (0)