forked from pollination/queenbee
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(hash): add __hash__ test to avoid pydantic 1.8 bug in future
fix pollination#280
- Loading branch information
1 parent
179d93e
commit e96cc07
Showing
3 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import pytest | ||
|
||
from ._base import BaseTestClass | ||
|
||
@pytest.mark.hash | ||
class BaseHashTest(BaseTestClass): | ||
|
||
def pytest_generate_tests(self, metafunc): | ||
|
||
object_instances = self.fixture_instances('valid') | ||
|
||
if "instance" in metafunc.fixturenames: | ||
metafunc.parametrize("instance", object_instances) | ||
|
||
def test_generates_hash(self, instance): | ||
"""Test to check for bug introduced in Pydantic 1.8""" | ||
|
||
assert instance.__hash__ is not None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters