Fix random failures in tests on OSX and Windows

This commit is contained in:
Julien Duponchelle 2015-08-25 10:13:49 +02:00
parent f0f901a15d
commit 796ca86df9

View File

@ -28,6 +28,8 @@ from unittest.mock import patch
sys._called_from_test = True
sys.original_platform = sys.platform
# Prevent execution of external binaries
os.environ["PATH"] = tempfile.mkdtemp()
@ -158,6 +160,9 @@ def run_around_tests(monkeypatch):
monkeypatch.setattr("gns3server.modules.project.Project._get_default_project_directory", lambda *args: tmppath)
# Force sys.platform to the original value. Because it seem not be restore correctly at each tests
sys.platform = sys.original_platform
yield
# An helper should not raise Exception