Skip to content

Commit a616445

Browse files
Make uberjob.Plan and various internal atom objects picklable
1 parent f77e3f1 commit a616445

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/uberjob/_util/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def is_ipython():
3939
class OmittedType:
4040
def __new__(cls):
4141
return Omitted
42-
42+
4343
def __getnewargs__(self):
4444
return ()
4545

@@ -53,7 +53,7 @@ def __repr__(self):
5353
class MissingType:
5454
def __new__(cls):
5555
return Missing
56-
56+
5757
def __getnewargs__(self):
5858
return ()
5959

tests/test_atoms.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,22 @@
3131

3232
class AtomTestCase(unittest.TestCase):
3333
def test_atom_singleton(self):
34-
for atom_type, atom, atom_repr in ATOMS:
34+
for atom_type, atom, _ in ATOMS:
3535
with self.subTest(atom_type_name=atom_type.__name__):
3636
self.assertIs(atom_type(), atom_type())
3737
self.assertIs(atom_type(), atom)
3838

3939
def test_atom_pickle_round_trip_is_atom(self):
40-
for atom_type, atom, atom_repr in ATOMS:
40+
for atom_type, atom, _ in ATOMS:
4141
with self.subTest(atom_type_name=atom_type.__name__):
4242
self.assertIs(pickle.loads(pickle.dumps(atom)), atom)
4343

4444
def test_type_of_atom_is_atom_type(self):
45-
for atom_type, atom, atom_repr in ATOMS:
45+
for atom_type, atom, _ in ATOMS:
4646
with self.subTest(atom_type_name=atom_type.__name__):
4747
self.assertIs(type(atom), atom_type)
4848

4949
def test_atom_repr(self):
5050
for atom_type, atom, atom_repr in ATOMS:
5151
with self.subTest(atom_type_name=atom_type.__name__):
52-
self.assertEqual(repr(atom), atom_repr)
52+
self.assertEqual(repr(atom), atom_repr)

tests/test_plan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,4 +411,4 @@ def test_plan_pickle_round_trip(self):
411411
result = plan.call(pow, 3, 2)
412412
plan2, result2 = pickle.loads(pickle.dumps([plan, result]))
413413
self.assertEqual(plan2._scope, ())
414-
self.assertEqual(uberjob.run(plan2, output=result2), 9)
414+
self.assertEqual(uberjob.run(plan2, output=result2), 9)

0 commit comments

Comments
 (0)