mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-11-16 16:54:51 +02:00
Fix random failures in tests on OSX and Windows
This commit is contained in:
parent
f0f901a15d
commit
796ca86df9
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user