Skip to content

Commit 3680012

Browse files
committed
check for network access for testing
1 parent e803ef4 commit 3680012

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

neo/test/rawiotest/tools.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,14 @@ def can_use_network():
1212
"""
1313
Return True if network access is allowed
1414
"""
15+
16+
if os.environ.get("NEO_TESTS_NO_NETWORK", False):
17+
return False
1518
try:
1619
import datalad
17-
1820
HAVE_DATALAD = True
1921
except:
2022
HAVE_DATALAD = False
2123
if not HAVE_DATALAD:
2224
return False
23-
if os.environ.get("NOSETESTS_NO_NETWORK", False):
24-
return False
25-
if os.environ.get("TRAVIS") == "true":
26-
return False
2725
return True

neo/test/utils/test_datasets.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import unittest
2-
2+
import pytest
33
from neo.utils.datasets import download_dataset, default_testing_repo
4+
from neo.test.rawiotest.tools import can_use_network
45

56

7+
@pytest.mark.skipif(not can_use_network(), reason="Must have acess to network to run test")
68
class TestDownloadDataset(unittest.TestCase):
79
def test_download_dataset(self):
810
local_path = download_dataset(repo=default_testing_repo, remote_path="blackrock/blackrock_2_1")

0 commit comments

Comments
 (0)