From 1d9fc5caa947ff4ee72180185e91a9a145171712 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Thu, 18 Dec 2014 21:39:15 +0100 Subject: [PATCH] Made model_regress unpickling test CWD-independent Refs #24007. Thanks Tim Graham for his help with the patch. --- tests/model_regress/test_pickle.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/model_regress/test_pickle.py b/tests/model_regress/test_pickle.py index e52dc58783..5f97a72606 100644 --- a/tests/model_regress/test_pickle.py +++ b/tests/model_regress/test_pickle.py @@ -83,7 +83,10 @@ print(article.headline)""" script.write(script_template % pickle.dumps(a)) script.flush() try: - result = subprocess.check_output([sys.executable, script.name]) + result = subprocess.check_output( + [sys.executable, script.name], + env={'PYTHONPATH': ':'.join(sys.path)} + ) except subprocess.CalledProcessError: self.fail("Unable to reload model pickled data") self.assertEqual(result.strip().decode(), "Some object")