Skip to content

Commit

Permalink
Make pickle test more meaningful
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Mar 21, 2024
1 parent 1b07d97 commit f1ce8d7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@


class TestConverter:
def test_pickle(self):
@pytest.mark.parametrize("takes_self", [True, False])
@pytest.mark.parametrize("takes_field", [True, False])
def test_pickle(self, takes_self, takes_field):
"""
Wrapped converters can be pickled.
"""
c = Converter(int, takes_self=False)
c = Converter(int, takes_self=takes_self, takes_field=takes_field)

assert c == pickle.loads(pickle.dumps(c))

Expand Down

0 comments on commit f1ce8d7

Please sign in to comment.