Skip to content

Commit ce71dda

Browse files
dguidoclaude
andcommitted
fix: ruff lint errors in test file
- Sort imports correctly - Remove unnecessary mode argument from open() Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent b167358 commit ce71dda

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

tests/test_auto_library_linking.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
"""
22
Test auto library linking functionality
33
"""
4+
45
import json
56
import os
6-
from pathlib import Path
77
import shutil
8+
from pathlib import Path
89

910
from crytic_compile.crytic_compile import CryticCompile
1011
from crytic_compile.utils.libraries import get_deployment_order
@@ -40,12 +41,12 @@ def test_deployment_order():
4041
deployment_order, libraries_needed = get_deployment_order(dependencies, target_contracts)
4142

4243
# Check that deployment order only contains libraries, not target contracts
43-
assert (
44-
"TestComplexDependencies" not in deployment_order
45-
), "Target contracts should not be in deployment order"
46-
assert (
47-
"SimpleMathContract" not in deployment_order
48-
), "Target contracts should not be in deployment order"
44+
assert "TestComplexDependencies" not in deployment_order, (
45+
"Target contracts should not be in deployment order"
46+
)
47+
assert "SimpleMathContract" not in deployment_order, (
48+
"Target contracts should not be in deployment order"
49+
)
4950

5051
# MathLib should come first (no dependencies)
5152
assert deployment_order.index("MathLib") < deployment_order.index("AdvancedMath")
@@ -80,9 +81,9 @@ def test_no_autolink_without_flag():
8081
cc = CryticCompile(Path(TEST_DIR / "library_dependency_test.sol").as_posix())
8182

8283
# Check that autolink did not generate library addresses
83-
assert (
84-
cc.libraries is None or len(cc.libraries) == 0
85-
), "Autolink should not generate library addresses without flag"
84+
assert cc.libraries is None or len(cc.libraries) == 0, (
85+
"Autolink should not generate library addresses without flag"
86+
)
8687

8788
# Export and check that no autolink file is created
8889
export_files = cc.export(export_format="solc", export_dir="test_no_autolink_output")
@@ -128,15 +129,15 @@ def test_autolink_functionality():
128129

129130
assert autolink_file is not None, "Autolink file should be created"
130131

131-
with open(autolink_file, "r", encoding="utf8") as f:
132+
with open(autolink_file, encoding="utf8") as f:
132133
autolink_data = json.load(f)
133134

134135
# Check autolink file structure
135136
assert "deployment_order" in autolink_data, "Autolink file should contain deployment_order"
136137
assert "library_addresses" in autolink_data, "Autolink file should contain library_addresses"
137-
assert (
138-
len(autolink_data["library_addresses"]) > 0
139-
), "Should have library addresses in autolink file"
138+
assert len(autolink_data["library_addresses"]) > 0, (
139+
"Should have library addresses in autolink file"
140+
)
140141

141142
# Check deployment order contains expected contracts
142143
deployment_order = autolink_data["deployment_order"]

0 commit comments

Comments
 (0)