Skip to content

Commit b414962

Browse files
committed
refactor(test): TestConfigData -> ConfigTestData
tests/fixtures/structures.py:5 ~/work/python/tmuxp/tests/fixtures/structures.py:5: PytestCollectionWarning: cannot collect test class 'TestConfigData' because it has a __init__ constructor (from: tests/test_config.py) @dataclasses.dataclass -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
1 parent 3d4d437 commit b414962

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

tests/fixtures/structures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44

55
@dataclasses.dataclass
6-
class TestConfigData:
6+
class ConfigTestData:
77
expand1: t.Any
88
expand2: t.Any
99
expand_blank: t.Any

tests/test_config.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from .constants import EXAMPLE_PATH
1515

1616
if typing.TYPE_CHECKING:
17-
from .fixtures.structures import TestConfigData
17+
from .fixtures.structures import ConfigTestData
1818

1919

2020
@pytest.fixture
@@ -25,9 +25,9 @@ def config_fixture():
2525
os.path.expanduser until here.
2626
"""
2727
from .fixtures import config as test_config_data
28-
from .fixtures.structures import TestConfigData
28+
from .fixtures.structures import ConfigTestData
2929

30-
return TestConfigData(
30+
return ConfigTestData(
3131
**{
3232
k: v
3333
for k, v in test_config_data.__dict__.items()
@@ -52,7 +52,7 @@ def load_config(path: Union[str, pathlib.Path]) -> str:
5252
)
5353

5454

55-
def test_export_json(tmp_path: pathlib.Path, config_fixture: "TestConfigData"):
55+
def test_export_json(tmp_path: pathlib.Path, config_fixture: "ConfigTestData"):
5656
json_config_file = tmp_path / "config.json"
5757

5858
configparser = kaptan.Kaptan()
@@ -67,7 +67,7 @@ def test_export_json(tmp_path: pathlib.Path, config_fixture: "TestConfigData"):
6767
assert config_fixture.sampleconfig.sampleconfigdict == new_config_data
6868

6969

70-
def test_export_yaml(tmp_path: pathlib.Path, config_fixture: "TestConfigData"):
70+
def test_export_yaml(tmp_path: pathlib.Path, config_fixture: "ConfigTestData"):
7171
yaml_config_file = tmp_path / "config.yaml"
7272

7373
configparser = kaptan.Kaptan()
@@ -111,13 +111,13 @@ def test_scan_config(tmp_path: pathlib.Path):
111111
assert len(configs) == files
112112

113113

114-
def test_config_expand1(config_fixture: "TestConfigData"):
114+
def test_config_expand1(config_fixture: "ConfigTestData"):
115115
"""Expand shell commands from string to list."""
116116
test_config = config.expand(config_fixture.expand1.before_config)
117117
assert test_config == config_fixture.expand1.after_config()
118118

119119

120-
def test_config_expand2(config_fixture: "TestConfigData"):
120+
def test_config_expand2(config_fixture: "ConfigTestData"):
121121
"""Expand shell commands from string to list."""
122122
unexpanded_dict = load_yaml(config_fixture.expand2.unexpanded_yaml())
123123
expanded_dict = load_yaml(config_fixture.expand2.expanded_yaml())
@@ -236,7 +236,7 @@ def test_inheritance_config():
236236
assert config == inheritance_config_after
237237

238238

239-
def test_shell_command_before(config_fixture: "TestConfigData"):
239+
def test_shell_command_before(config_fixture: "ConfigTestData"):
240240
"""Config inheritance for the nested 'start_command'."""
241241
test_config = config_fixture.shell_command_before.config_unexpanded
242242
test_config = config.expand(test_config)
@@ -247,7 +247,7 @@ def test_shell_command_before(config_fixture: "TestConfigData"):
247247
assert test_config == config_fixture.shell_command_before.config_after()
248248

249249

250-
def test_in_session_scope(config_fixture: "TestConfigData"):
250+
def test_in_session_scope(config_fixture: "ConfigTestData"):
251251
sconfig = load_yaml(config_fixture.shell_command_before_session.before)
252252

253253
config.validate_schema(sconfig)
@@ -258,7 +258,7 @@ def test_in_session_scope(config_fixture: "TestConfigData"):
258258
)
259259

260260

261-
def test_trickle_relative_start_directory(config_fixture: "TestConfigData"):
261+
def test_trickle_relative_start_directory(config_fixture: "ConfigTestData"):
262262
test_config = config.trickle(config_fixture.trickle.before)
263263
assert test_config == config_fixture.trickle.expected
264264

@@ -281,7 +281,7 @@ def test_trickle_window_with_no_pane_config():
281281
}
282282

283283

284-
def test_expands_blank_panes(config_fixture: "TestConfigData"):
284+
def test_expands_blank_panes(config_fixture: "ConfigTestData"):
285285
"""Expand blank config into full form.
286286
287287
Handle ``NoneType`` and 'blank'::

0 commit comments

Comments
 (0)