/usr/local/lib/python3.6/site-packages/dill/tests
NameSizeModeActions
__pycache__/-0755rm
test_check.py12780644editdlrm
test_classdef.py48950644editdlrm
test_detect.py41420644editdlrm
test_diff.py27610644editdlrm
test_extendpickle.py13680644editdlrm
test_fglobals.py12970644editdlrm
test_file.py136420644editdlrm
test_functions.py16530644editdlrm
test_functors.py9300644editdlrm
test_mixins.py40070644editdlrm
test_module.py19670644editdlrm
test_moduledict.py11820644editdlrm
test_nested.py31340644editdlrm
test_objects.py17790644editdlrm
test_properties.py13460644editdlrm
test_recursive.py24550644editdlrm
test_restricted.py7830644editdlrm
test_selected.py25550644editdlrm
test_source.py63750644editdlrm
test_temp.py26190644editdlrm
test_weakref.py20560644editdlrm
__init__.py5010644editdlrm
__main__.py8350644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/dill/tests/test_functions.py (1653B)
#!/usr/bin/env python # # Author: Mike McKerns (mmckerns @caltech and @uqfoundation) # Copyright (c) 2019-2021 The Uncertainty Quantification Foundation. # License: 3-clause BSD. The full license text is available at: # - https://github.com/uqfoundation/dill/blob/master/LICENSE import dill import sys dill.settings['recurse'] = True def is_py3(): return hex(sys.hexversion) >= '0x30000f0' def function_a(a): return a def function_b(b, b1): return b + b1 def function_c(c, c1=1): return c + c1 def function_d(d, d1, d2=1): return d + d1 + d2 if is_py3(): exec(''' def function_e(e, *e1, e2=1, e3=2): return e + sum(e1) + e2 + e3''') def test_functions(): dumped_func_a = dill.dumps(function_a) assert dill.loads(dumped_func_a)(0) == 0 dumped_func_b = dill.dumps(function_b) assert dill.loads(dumped_func_b)(1,2) == 3 dumped_func_c = dill.dumps(function_c) assert dill.loads(dumped_func_c)(1) == 2 assert dill.loads(dumped_func_c)(1, 2) == 3 dumped_func_d = dill.dumps(function_d) assert dill.loads(dumped_func_d)(1, 2) == 4 assert dill.loads(dumped_func_d)(1, 2, 3) == 6 assert dill.loads(dumped_func_d)(1, 2, d2=3) == 6 if is_py3(): exec(''' dumped_func_e = dill.dumps(function_e) assert dill.loads(dumped_func_e)(1, 2) == 6 assert dill.loads(dumped_func_e)(1, 2, 3) == 9 assert dill.loads(dumped_func_e)(1, 2, e2=3) == 8 assert dill.loads(dumped_func_e)(1, 2, e2=3, e3=4) == 10 assert dill.loads(dumped_func_e)(1, 2, 3, e2=4) == 12 assert dill.loads(dumped_func_e)(1, 2, 3, e2=4, e3=5) == 15''') if __name__ == '__main__': test_functions()