Skip to content

Commit c0b9308

Browse files
committed
SQ -> tests: Refactor organize modules into tree
1 parent 3dff613 commit c0b9308

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

tests/test_runner.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,45 +34,45 @@ class TestNormalizeTestNames:
3434

3535
def test_qualified_module_name(self) -> None:
3636
"""Test that qualified module names work correctly."""
37-
result = normalize_test_names(['crystal.tests.test_workflows'])
38-
assert result == ['crystal.tests.test_workflows']
37+
result = normalize_test_names(['crystal.tests.workflows.test_workflows'])
38+
assert result == ['crystal.tests.workflows.test_workflows']
3939

4040
def test_qualified_function_name(self) -> None:
4141
"""Test that qualified function names work correctly."""
42-
result = normalize_test_names(['crystal.tests.test_workflows.test_can_download_and_serve_a_static_site_using_main_window_ui'])
43-
assert result == ['crystal.tests.test_workflows.test_can_download_and_serve_a_static_site_using_main_window_ui']
42+
result = normalize_test_names(['crystal.tests.workflows.test_workflows.test_can_download_and_serve_a_static_site_using_main_window_ui'])
43+
assert result == ['crystal.tests.workflows.test_workflows.test_can_download_and_serve_a_static_site_using_main_window_ui']
4444

4545
def test_unqualified_module_name(self) -> None:
4646
"""Test that unqualified module names are resolved correctly."""
4747
result = normalize_test_names(['test_workflows'])
48-
assert result == ['crystal.tests.test_workflows']
48+
assert result == ['crystal.tests.workflows.test_workflows']
4949

5050
def test_file_path_notation(self) -> None:
5151
"""Test that file path notation is converted correctly."""
52-
result = normalize_test_names(['src/crystal/tests/test_workflows.py'])
53-
assert result == ['crystal.tests.test_workflows']
52+
result = normalize_test_names(['src/crystal/tests/workflows/test_workflows.py'])
53+
assert result == ['crystal.tests.workflows.test_workflows']
5454

5555
def test_pytest_style_function_notation(self) -> None:
5656
"""Test that pytest-style function notation (::) is converted correctly."""
57-
result = normalize_test_names(['crystal.tests.test_workflows::test_can_download_and_serve_a_static_site_using_main_window_ui'])
58-
assert result == ['crystal.tests.test_workflows.test_can_download_and_serve_a_static_site_using_main_window_ui']
57+
result = normalize_test_names(['crystal.tests.workflows.test_workflows::test_can_download_and_serve_a_static_site_using_main_window_ui'])
58+
assert result == ['crystal.tests.workflows.test_workflows.test_can_download_and_serve_a_static_site_using_main_window_ui']
5959

6060
def test_unqualified_function_name(self) -> None:
6161
"""Test that unqualified function names are resolved correctly."""
6262
result = normalize_test_names(['test_can_download_and_serve_a_static_site_using_main_window_ui'])
63-
assert result == ['crystal.tests.test_workflows.test_can_download_and_serve_a_static_site_using_main_window_ui']
63+
assert result == ['crystal.tests.workflows.test_workflows.test_can_download_and_serve_a_static_site_using_main_window_ui']
6464

6565
def test_multiple_test_names(self) -> None:
6666
"""Test that multiple test names are all normalized correctly."""
6767
result = normalize_test_names([
6868
'test_workflows',
69-
'crystal.tests.test_bulkheads::test_capture_crashes_to_self_decorator_works',
70-
'src/crystal/tests/test_xthreading.py'
69+
'crystal.tests.util_tests.test_bulkheads::test_capture_crashes_to_self_decorator_works',
70+
'src/crystal/tests/util_tests/test_xthreading.py'
7171
])
7272
expected = [
73-
'crystal.tests.test_workflows',
74-
'crystal.tests.test_bulkheads.test_capture_crashes_to_self_decorator_works',
75-
'crystal.tests.test_xthreading'
73+
'crystal.tests.workflows.test_workflows',
74+
'crystal.tests.util_tests.test_bulkheads.test_capture_crashes_to_self_decorator_works',
75+
'crystal.tests.util_tests.test_xthreading'
7676
]
7777
assert result == expected
7878

@@ -108,19 +108,19 @@ def test_invalid_pytest_style_format(self) -> None:
108108

109109
def test_file_path_without_src_prefix(self) -> None:
110110
"""Test that file paths without 'src/' prefix work correctly."""
111-
result = normalize_test_names(['crystal/tests/test_workflows.py'])
112-
assert result == ['crystal.tests.test_workflows']
111+
result = normalize_test_names(['crystal/tests/workflows/test_workflows.py'])
112+
assert result == ['crystal.tests.workflows.test_workflows']
113113

114114
def test_windows_style_file_path(self) -> None:
115115
"""Test that Windows-style file paths work correctly."""
116-
result = normalize_test_names(['src\\crystal\\tests\\test_workflows.py'])
117-
assert result == ['crystal.tests.test_workflows']
116+
result = normalize_test_names(['src\\crystal\\tests\\workflows\\test_workflows.py'])
117+
assert result == ['crystal.tests.workflows.test_workflows']
118118

119119
def test_partial_module_match(self) -> None:
120120
"""Test that partial module names are resolved correctly."""
121121
# This should match any module ending with test_workflows
122122
result = normalize_test_names(['test_workflows'])
123-
assert 'crystal.tests.test_workflows' in result
123+
assert 'crystal.tests.workflows.test_workflows' in result
124124

125125
def test_case_sensitivity(self) -> None:
126126
"""Test that function names are case-sensitive."""

0 commit comments

Comments
 (0)