|
32 | 32 | format_for_console |
33 | 33 | ) |
34 | 34 |
|
| 35 | +@pytest.fixture |
| 36 | +def sample_match(): |
| 37 | + return { |
| 38 | + "file_name": "setup.py", |
| 39 | + "file_path": "google-cloud-python/main/packages/pkg_a/setup.py", |
| 40 | + "repo_path": "packages/pkg_a/setup.py", |
| 41 | + "package_name": "pkg_a", |
| 42 | + "rule_name": "python_requires_check", |
| 43 | + "line_number": "123", |
| 44 | + "matched_string": "3.7", |
| 45 | + "context_line": "python_requires = '>=3.7'", |
| 46 | + "dependency": "python", |
| 47 | + "version": "3.7" |
| 48 | + } |
| 49 | + |
| 50 | + |
35 | 51 | # Test ConfigManager |
36 | 52 | @pytest.mark.parametrize("dependency, version, expected", [ |
37 | 53 | ( |
@@ -682,21 +698,6 @@ def test_safe_int(): |
682 | 698 | assert _safe_int(None) == 0 |
683 | 699 | assert _safe_int("abc") == 0 |
684 | 700 |
|
685 | | -@pytest.fixture |
686 | | -def sample_match(): |
687 | | - return { |
688 | | - "file_name": "setup.py", |
689 | | - "file_path": "google-cloud-python/main/packages/pkg_a/setup.py", |
690 | | - "repo_path": "packages/pkg_a/setup.py", |
691 | | - "package_name": "pkg_a", |
692 | | - "rule_name": "python_requires_check", |
693 | | - "line_number": "123", |
694 | | - "matched_string": "3.7", |
695 | | - "context_line": "python_requires = '>=3.7'", |
696 | | - "dependency": "python", |
697 | | - "version": "3.7" |
698 | | - } |
699 | | - |
700 | 701 | def test_format_for_raw_csv_handles_empty_line_number(sample_match): |
701 | 702 | sample_match["line_number"] = "" |
702 | 703 | formatted = format_for_raw_csv(sample_match) |
|
0 commit comments