mirror of
https://github.com/codeflash-ai/codeflash.git
synced 2026-05-04 18:25:17 +00:00
refactor: remove redundant try/finally; rely on conftest autouse fixture for language cleanup
The conftest.py autouse fixture already resets _current_language before/after each test, making per-test try/finally cleanup unnecessary. Co-authored-by: Kevin Turcios <KRRT7@users.noreply.github.com>
This commit is contained in:
parent
0672e11342
commit
4c9abfb2aa
1 changed files with 39 additions and 43 deletions
|
|
@ -4,13 +4,11 @@ from tempfile import TemporaryDirectory
|
|||
|
||||
from codeflash.languages import set_current_language
|
||||
from codeflash.languages.base import Language
|
||||
from codeflash.languages.current import reset_current_language
|
||||
from codeflash.languages.java.line_profiler import JavaLineProfiler
|
||||
|
||||
|
||||
def test_parse_line_profile_results_non_python_java_json():
|
||||
set_current_language(Language.JAVA)
|
||||
try:
|
||||
with TemporaryDirectory() as tmpdir:
|
||||
tmp_path = Path(tmpdir)
|
||||
source_file = tmp_path / "Util.java"
|
||||
|
|
@ -57,5 +55,3 @@ def test_parse_line_profile_results_non_python_java_json():
|
|||
)
|
||||
assert (source_file.as_posix(), 3, "Util.java") in results["timings"]
|
||||
assert results["timings"][(source_file.as_posix(), 3, "Util.java")] == [(3, 6, 1000), (4, 6, 2000)]
|
||||
finally:
|
||||
reset_current_language()
|
||||
|
|
|
|||
Loading…
Reference in a new issue