Skip to content

Commit 216e841

Browse files
HyukjinKwonrgbkrk
authored andcommitted
Fix few missed corrections
1 parent f2f153b commit 216e841

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

tests/cloudpickle_test.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
from cloudpickle.cloudpickle import _find_module, _make_empty_cell, cell_set
4545

4646
from .testutils import subprocess_pickle_echo
47+
from .testutils import assert_run_python_script
4748

4849

4950
HAVE_WEAKSET = hasattr(weakref, 'WeakSet')
@@ -766,30 +767,30 @@ def f3():
766767
def f4(x):
767768
return foo.method(x)
768769
769-
cloned = subprocess_pickle_echo(lambda x: x**2, protocol={protocol})
770+
cloned = subprocess_pickle_echo(lambda x: x**2)
770771
assert cloned(3) == 9
771772
772-
cloned = subprocess_pickle_echo(f0, protocol={protocol})
773+
cloned = subprocess_pickle_echo(f0)
773774
assert cloned(3) == 9
774775
775-
cloned = subprocess_pickle_echo(Foo, protocol={protocol})
776+
cloned = subprocess_pickle_echo(Foo)
776777
assert cloned().method(2) == Foo().method(2)
777778
778-
cloned = subprocess_pickle_echo(Foo(), protocol={protocol})
779+
cloned = subprocess_pickle_echo(Foo())
779780
assert cloned.method(2) == Foo().method(2)
780781
781-
cloned = subprocess_pickle_echo(f1, protocol={protocol})
782+
cloned = subprocess_pickle_echo(f1)
782783
assert cloned()().method('a') == f1()().method('a')
783784
784-
cloned = subprocess_pickle_echo(f2, protocol={protocol})
785+
cloned = subprocess_pickle_echo(f2)
785786
assert cloned(2) == f2(2)
786787
787-
cloned = subprocess_pickle_echo(f3, protocol={protocol})
788+
cloned = subprocess_pickle_echo(f3)
788789
assert cloned() == f3()
789790
790-
cloned = subprocess_pickle_echo(f4, protocol={protocol})
791+
cloned = subprocess_pickle_echo(f4)
791792
assert cloned(2) == f4(2)
792-
""".format(protocol=self.protocol)
793+
"""
793794
assert_run_python_script(textwrap.dedent(code))
794795

795796
@pytest.mark.skipif(sys.version_info >= (3, 0),

tests/testutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def subprocess_pickle_echo(input_data):
2828
[1, 'a', None]
2929
3030
"""
31-
pickled_input_data = dumps(input_data, protocol=protocol)
31+
pickled_input_data = dumps(input_data)
3232
cmd = [sys.executable, __file__] # run then pickle_echo() in __main__
3333
cloudpickle_repo_folder = op.normpath(
3434
op.join(op.dirname(__file__), '..'))

0 commit comments

Comments
 (0)