Skip to content

Commit 7a102dd

Browse files
committed
fix: error in dataclass test
1 parent b7b0055 commit 7a102dd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/test_config_manager.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import os
66
import shutil
77
import tempfile
8-
from dataclasses import dataclass
8+
from dataclasses import dataclass, field
99
from pathlib import Path
1010
from typing import Any, Dict, Optional
1111

@@ -32,7 +32,7 @@ class TestConfig:
3232
title: str = "test"
3333
enabled: bool = True
3434
number: int = 100
35-
nested: NestedConfig = NestedConfig()
35+
nested: NestedConfig = field(default_factory=NestedConfig)
3636

3737

3838
try:

tests/test_config_model.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import os
66
import tempfile
7-
from dataclasses import dataclass
7+
from dataclasses import dataclass, field
88
from typing import Optional
99

1010
import pytest
@@ -23,7 +23,7 @@ class DataclassConfig:
2323
title: str = "dataclass"
2424
enabled: bool = True
2525
number: int = 100
26-
nested: NestedConfig = NestedConfig()
26+
nested: NestedConfig = field(default_factory=NestedConfig)
2727

2828

2929
try:

0 commit comments

Comments
 (0)