Skip to content

Commit fe90acf

Browse files
committed
no windows for now
1 parent 95ccec3 commit fe90acf

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed

tests/test_async_function_discovery.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import tempfile
22
from pathlib import Path
3+
import sys
34
import pytest
45

56
from codeflash.discovery.functions_to_optimize import (
@@ -16,6 +17,7 @@ def temp_dir():
1617
yield Path(temp)
1718

1819

20+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
1921
def test_async_function_detection(temp_dir):
2022
async_function = """
2123
async def async_function_with_return():
@@ -41,6 +43,7 @@ def regular_function():
4143
assert "async_function_without_return" not in function_names
4244

4345

46+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
4447
def test_async_method_in_class(temp_dir):
4548
code_with_async_method = """
4649
class AsyncClass:
@@ -73,6 +76,7 @@ def sync_method(self):
7376
assert "async_method_no_return" not in function_names
7477

7578

79+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
7680
def test_nested_async_functions(temp_dir):
7781
nested_async = """
7882
async def outer_async():
@@ -100,6 +104,7 @@ async def inner_async():
100104
assert "inner_async" not in function_names
101105

102106

107+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
103108
def test_async_staticmethod_and_classmethod(temp_dir):
104109
async_decorators = """
105110
class MyClass:
@@ -130,6 +135,7 @@ async def async_property(self):
130135
assert "async_property" not in function_names
131136

132137

138+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
133139
def test_async_generator_functions(temp_dir):
134140
async_generators = """
135141
async def async_generator_with_return():
@@ -157,6 +163,7 @@ async def regular_async_with_return():
157163
assert "async_generator_no_return" not in function_names
158164

159165

166+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
160167
def test_inspect_async_top_level_functions(temp_dir):
161168
code = """
162169
async def top_level_async():
@@ -198,6 +205,7 @@ async def async_classmethod(cls):
198205
assert result.is_classmethod
199206

200207

208+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
201209
def test_get_functions_to_optimize_with_async(temp_dir):
202210
mixed_code = """
203211
async def async_func_one():
@@ -250,6 +258,7 @@ def sync_method(self):
250258
assert "async_func_two" not in function_names
251259

252260

261+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
253262
def test_no_async_functions_finding(temp_dir):
254263
mixed_code = """
255264
async def async_func_one():
@@ -300,6 +309,7 @@ def sync_method(self):
300309
assert "async_method" not in function_names
301310

302311

312+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
303313
def test_async_function_parents(temp_dir):
304314
complex_structure = """
305315
class OuterClass:

tests/test_async_run_and_parse_tests.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
from __future__ import annotations
22

33
import os
4+
import sys
45
from argparse import Namespace
56
from pathlib import Path
67

8+
import pytest
9+
710
from codeflash.discovery.functions_to_optimize import FunctionToOptimize
811
from codeflash.models.models import CodePosition, FunctionParent, TestFile, TestFiles, TestingMode, TestType
912
from codeflash.optimization.optimizer import Optimizer
1013
from codeflash.verification.instrument_codeflash_capture import instrument_codeflash_capture
1114
from codeflash.code_utils.instrument_existing_tests import instrument_source_module_with_async_decorators, inject_profiling_into_existing_test
1215

16+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
1317
def test_async_bubble_sort_behavior_results() -> None:
1418
test_code = """import asyncio
1519
import pytest
@@ -137,6 +141,7 @@ async def test_async_sort():
137141
test_path_perf.unlink()
138142

139143

144+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
140145
def test_async_class_method_behavior_results() -> None:
141146
"""Test async class method behavior with run_and_parse_tests."""
142147
test_code = """import asyncio
@@ -260,6 +265,7 @@ async def test_async_class_sort():
260265
test_path_perf.unlink()
261266

262267

268+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
263269
def test_async_function_performance_mode() -> None:
264270
test_code = """import asyncio
265271
import pytest
@@ -354,6 +360,7 @@ async def test_async_perf():
354360

355361

356362

363+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
357364
def test_async_function_error_handling() -> None:
358365
test_code = """import asyncio
359366
import pytest
@@ -516,6 +523,7 @@ async def async_error_function(lst):
516523
test_path_perf.unlink()
517524

518525

526+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
519527
def test_async_multiple_iterations() -> None:
520528
test_code = """import asyncio
521529
import pytest
@@ -624,6 +632,7 @@ async def test_async_multi():
624632
test_path_perf.unlink()
625633

626634

635+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
627636
def test_async_empty_input_edge_cases() -> None:
628637
test_code = """import asyncio
629638
import pytest
@@ -741,6 +750,7 @@ async def test_async_edge_cases():
741750
test_path_perf.unlink()
742751

743752

753+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
744754
def test_sync_function_behavior_in_async_test_environment() -> None:
745755
sync_sorter_code = """def sync_sorter(lst):
746756
\"\"\"Synchronous bubble sort for comparison.\"\"\"
@@ -880,6 +890,7 @@ def test_sync_sort():
880890
test_path_perf.unlink()
881891

882892

893+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
883894
def test_mixed_async_sync_function_calls() -> None:
884895
mixed_module_code = """import asyncio
885896
from typing import List, Union

tests/test_async_wrapper_sqlite_validation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import asyncio
44
import os
55
import sqlite3
6+
import sys
67
import tempfile
78
from pathlib import Path
89

@@ -16,6 +17,7 @@
1617
from codeflash.verification.codeflash_capture import VerificationType
1718

1819

20+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
1921
class TestAsyncWrapperSQLiteValidation:
2022

2123
@pytest.fixture

tests/test_instrument_async_tests.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from pathlib import Path
33
import uuid
44
import os
5+
import sys
56

67
import pytest
78

@@ -52,6 +53,7 @@ def temp_dir():
5253
# pass # Ignore cleanup errors
5354

5455

56+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
5557
def test_async_decorator_application_behavior_mode():
5658
async_function_code = '''
5759
import asyncio
@@ -86,6 +88,7 @@ async def async_function(x: int, y: int) -> int:
8688
assert modified_code.strip() == expected_decorated_code.strip()
8789

8890

91+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
8992
def test_async_decorator_application_performance_mode():
9093
async_function_code = '''
9194
import asyncio
@@ -120,6 +123,7 @@ async def async_function(x: int, y: int) -> int:
120123
assert modified_code.strip() == expected_decorated_code.strip()
121124

122125

126+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
123127
def test_async_class_method_decorator_application():
124128
async_class_code = '''
125129
import asyncio
@@ -171,6 +175,7 @@ def sync_method(self, a: int, b: int) -> int:
171175
assert modified_code.strip() == expected_decorated_code.strip()
172176

173177

178+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
174179
def test_async_decorator_no_duplicate_application():
175180
already_decorated_code = '''
176181
from codeflash.code_utils.codeflash_wrap_decorator import codeflash_behavior_async
@@ -207,6 +212,7 @@ async def async_function(x: int, y: int) -> int:
207212
assert modified_code.strip() == expected_reformatted_code.strip()
208213

209214

215+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
210216
def test_inject_profiling_async_function_behavior_mode(temp_dir):
211217
source_module_code = '''
212218
import asyncio
@@ -265,6 +271,7 @@ async def test_async_function():
265271
assert instrumented_test_code is None
266272

267273

274+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
268275
def test_inject_profiling_async_function_performance_mode(temp_dir):
269276
source_module_code = '''
270277
import asyncio
@@ -324,6 +331,7 @@ async def test_async_function():
324331
assert instrumented_test_code is None
325332

326333

334+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
327335
def test_mixed_sync_async_instrumentation(temp_dir):
328336
source_module_code = '''
329337
import asyncio
@@ -394,6 +402,7 @@ async def test_mixed_functions():
394402
assert instrumented_test_code is None
395403

396404

405+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
397406
def test_async_function_qualified_name_handling():
398407
nested_async_code = '''
399408
import asyncio
@@ -435,6 +444,7 @@ async def nested_async_method(self, x: int) -> int:
435444
assert modified_code.strip() == expected_output.strip()
436445

437446

447+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
438448
def test_async_decorator_with_existing_decorators():
439449
"""Test async decorator application when function already has other decorators."""
440450
decorated_async_code = '''
@@ -470,6 +480,7 @@ async def async_function(x: int, y: int) -> int:
470480
assert codeflash_pos < my_decorator_pos
471481

472482

483+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
473484
def test_sync_function_not_affected_by_async_logic():
474485
sync_function_code = '''
475486
def sync_function(x: int, y: int) -> int:
@@ -491,6 +502,7 @@ def sync_function(x: int, y: int) -> int:
491502
assert not decorator_added
492503
assert modified_code == sync_function_code
493504

505+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
494506
def test_inject_profiling_async_multiple_calls_same_test(temp_dir):
495507
"""Test that multiple async function calls within the same test function get correctly numbered 0, 1, 2, etc."""
496508
source_module_code = '''
@@ -579,6 +591,7 @@ async def test_multiple_calls():
579591

580592

581593

594+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
582595
def test_async_behavior_decorator_return_values_and_test_ids():
583596
"""Test that async behavior decorator correctly captures return values, test IDs, and stores data in database."""
584597
import asyncio
@@ -677,6 +690,7 @@ async def test_async_multiply(x: int, y: int) -> int:
677690
del os.environ[k]
678691

679692

693+
@pytest.mark.skipif(sys.platform == "win32", reason="pending support for asyncio on windows")
680694
def test_async_decorator_comprehensive_return_values_and_test_ids():
681695
import asyncio
682696
import os

0 commit comments

Comments
 (0)