|
44 | 44 | from cloudpickle.cloudpickle import _find_module, _make_empty_cell, cell_set |
45 | 45 |
|
46 | 46 | from .testutils import subprocess_pickle_echo |
| 47 | +from .testutils import assert_run_python_script |
47 | 48 |
|
48 | 49 |
|
49 | 50 | HAVE_WEAKSET = hasattr(weakref, 'WeakSet') |
@@ -766,30 +767,30 @@ def f3(): |
766 | 767 | def f4(x): |
767 | 768 | return foo.method(x) |
768 | 769 |
|
769 | | - cloned = subprocess_pickle_echo(lambda x: x**2, protocol={protocol}) |
| 770 | + cloned = subprocess_pickle_echo(lambda x: x**2) |
770 | 771 | assert cloned(3) == 9 |
771 | 772 |
|
772 | | - cloned = subprocess_pickle_echo(f0, protocol={protocol}) |
| 773 | + cloned = subprocess_pickle_echo(f0) |
773 | 774 | assert cloned(3) == 9 |
774 | 775 |
|
775 | | - cloned = subprocess_pickle_echo(Foo, protocol={protocol}) |
| 776 | + cloned = subprocess_pickle_echo(Foo) |
776 | 777 | assert cloned().method(2) == Foo().method(2) |
777 | 778 |
|
778 | | - cloned = subprocess_pickle_echo(Foo(), protocol={protocol}) |
| 779 | + cloned = subprocess_pickle_echo(Foo()) |
779 | 780 | assert cloned.method(2) == Foo().method(2) |
780 | 781 |
|
781 | | - cloned = subprocess_pickle_echo(f1, protocol={protocol}) |
| 782 | + cloned = subprocess_pickle_echo(f1) |
782 | 783 | assert cloned()().method('a') == f1()().method('a') |
783 | 784 |
|
784 | | - cloned = subprocess_pickle_echo(f2, protocol={protocol}) |
| 785 | + cloned = subprocess_pickle_echo(f2) |
785 | 786 | assert cloned(2) == f2(2) |
786 | 787 |
|
787 | | - cloned = subprocess_pickle_echo(f3, protocol={protocol}) |
| 788 | + cloned = subprocess_pickle_echo(f3) |
788 | 789 | assert cloned() == f3() |
789 | 790 |
|
790 | | - cloned = subprocess_pickle_echo(f4, protocol={protocol}) |
| 791 | + cloned = subprocess_pickle_echo(f4) |
791 | 792 | assert cloned(2) == f4(2) |
792 | | - """.format(protocol=self.protocol) |
| 793 | + """ |
793 | 794 | assert_run_python_script(textwrap.dedent(code)) |
794 | 795 |
|
795 | 796 | @pytest.mark.skipif(sys.version_info >= (3, 0), |
|
0 commit comments