From c03c66ec48815ec68a5987dd82c2283058b9aa0c Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Tue, 26 May 2015 11:35:06 +0200 Subject: [PATCH] Fix tests crash on travis --- .travis.yml | 1 - tests/handlers/api/test_network.py | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7fa6ede7..f52a902e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,6 @@ before_install: - sudo add-apt-repository ppa:gns3/ppa -y - sudo apt-get update -q - sudo apt-get install dynamips - - sudo apt-get install python3-netifaces install: - python setup.py install diff --git a/tests/handlers/api/test_network.py b/tests/handlers/api/test_network.py index d675d4f6..1bad3a8a 100644 --- a/tests/handlers/api/test_network.py +++ b/tests/handlers/api/test_network.py @@ -15,6 +15,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +import os +import pytest + def test_udp_allocation(server, project): response = server.post('/projects/{}/ports/udp'.format(project.id), {}, example=True) @@ -22,6 +25,8 @@ def test_udp_allocation(server, project): assert response.json == {'udp_port': 10000} +# Netfifaces is not available on Travis +@pytest.skipif(os.environ.get("TRAVIS", False)) def test_interfaces(server): response = server.get('/interfaces', example=True) assert response.status == 200