Skip to content

Commit 7137ac6

Browse files
committed
rename conftest
1 parent 3dd705b commit 7137ac6

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

codeflash/code_utils/code_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import tomlkit
1414

1515
from codeflash.cli_cmds.console import logger
16-
from codeflash.code_utils.config_parser import find_pyproject_toml, find_conftest
16+
from codeflash.code_utils.config_parser import find_conftest, find_pyproject_toml
1717

1818

1919
@contextmanager
@@ -84,6 +84,7 @@ def add_addopts_to_pyproject() -> None:
8484
with Path.open(pyproject_file, "w", encoding="utf-8") as f:
8585
f.write(original_content)
8686

87+
8788
@contextmanager
8889
def rename_conftest() -> None:
8990
conftest_file = find_conftest()
@@ -98,6 +99,7 @@ def rename_conftest() -> None:
9899
if conftest_file.exists():
99100
tmp_conftest_file.rename(conftest_file)
100101

102+
101103
def encoded_tokens_len(s: str) -> int:
102104
"""Return the approximate length of the encoded tokens.
103105

codeflash/code_utils/config_parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def find_pyproject_toml(config_file: Path | None = None) -> Path:
3030

3131
raise ValueError(msg)
3232

33+
3334
def find_conftest() -> Union[Path, None]:
3435
# Find the conftest file on the root of the project
3536
dir_path = Path.cwd()

codeflash/discovery/discover_unit_tests.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@
1616
from pydantic.dataclasses import dataclass
1717

1818
from codeflash.cli_cmds.console import console, logger, test_files_progress_bar
19-
from codeflash.code_utils.code_utils import custom_addopts, get_run_tmp_file, module_name_from_file_path, \
20-
rename_conftest
19+
from codeflash.code_utils.code_utils import (
20+
custom_addopts,
21+
get_run_tmp_file,
22+
module_name_from_file_path,
23+
rename_conftest,
24+
)
2125
from codeflash.code_utils.compat import SAFE_SYS_EXECUTABLE, codeflash_cache_db
2226
from codeflash.models.models import CodePosition, FunctionCalledInTest, TestsInFile, TestType
2327

0 commit comments

Comments
 (0)