Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tests): Pytest warning on EIP-2537 tests #590

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions tests/prague/eip2537_bls_12_381_precompiles/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def current_python_script_directory(*args: str) -> str:
return os.path.join(os.path.dirname(os.path.realpath(__file__)), *args)


class TestVector(BaseModel):
class Vector(BaseModel):
"""
Test vector for the BLS12-381 precompiles.
"""
Expand All @@ -35,7 +35,7 @@ def to_pytest_param(self):
return pytest.param(self.input, self.expected, id=self.name)


class FailTestVector(BaseModel):
class FailVector(BaseModel):
"""
Test vector for the BLS12-381 precompiles.
"""
Expand All @@ -53,15 +53,15 @@ def to_pytest_param(self):
return pytest.param(self.input, id=self.name)


class TestVectorList(RootModel):
class VectorList(RootModel):
"""
List of test vectors for the BLS12-381 precompiles.
"""

root: List[TestVector | FailTestVector]
root: List[Vector | FailVector]


TestVectorListAdapter = TypeAdapter(TestVectorList)
VectorListAdapter = TypeAdapter(VectorList)


def vectors_from_file(filename: str) -> List:
Expand All @@ -75,4 +75,4 @@ def vectors_from_file(filename: str) -> List:
),
"rb",
) as f:
return [v.to_pytest_param() for v in TestVectorListAdapter.validate_json(f.read()).root]
return [v.to_pytest_param() for v in VectorListAdapter.validate_json(f.read()).root]