Made model_regress unpickling test CWD-independent
Refs #24007. Thanks Tim Graham for his help with the patch.
This commit is contained in:
parent
337cd09836
commit
1d9fc5caa9
|
@ -83,7 +83,10 @@ print(article.headline)"""
|
||||||
script.write(script_template % pickle.dumps(a))
|
script.write(script_template % pickle.dumps(a))
|
||||||
script.flush()
|
script.flush()
|
||||||
try:
|
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:
|
except subprocess.CalledProcessError:
|
||||||
self.fail("Unable to reload model pickled data")
|
self.fail("Unable to reload model pickled data")
|
||||||
self.assertEqual(result.strip().decode(), "Some object")
|
self.assertEqual(result.strip().decode(), "Some object")
|
||||||
|
|
Loading…
Reference in New Issue