Skip to content

Commit 3c0b8fe

Browse files
committed
chore(version-scanner): move sample_match fixture to the top of test file
1 parent f1c47bb commit 3c0b8fe

1 file changed

Lines changed: 16 additions & 15 deletions

File tree

scripts/version_scanner/tests/unit/test_version_scanner.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,22 @@
3232
format_for_console
3333
)
3434

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+
3551
# Test ConfigManager
3652
@pytest.mark.parametrize("dependency, version, expected", [
3753
(
@@ -682,21 +698,6 @@ def test_safe_int():
682698
assert _safe_int(None) == 0
683699
assert _safe_int("abc") == 0
684700

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-
700701
def test_format_for_raw_csv_handles_empty_line_number(sample_match):
701702
sample_match["line_number"] = ""
702703
formatted = format_for_raw_csv(sample_match)

0 commit comments

Comments
 (0)