Skip to content

Commit 05577ce

Browse files
authored
Merge pull request #1224 from a-detiste/master
allow to skip tests requiring internet access by defining NO_NET_ACCESS
2 parents 240e543 + 88e69e3 commit 05577ce

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

src/asammdf/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""asammdf version module"""
22

3-
__version__ = "8.5.0"
3+
__version__ = "8.5.1"

test/asammdf/gui/widgets/batch/test_BatchWidget_Tab_BusLogging.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/usr/bin/env python
22
import codecs
3+
import os
34
from pathlib import Path
45
import sys
6+
import unittest
57
from unittest import mock
68
import urllib
79
import urllib.request
@@ -18,6 +20,7 @@
1820
# to avoid initializing widgets multiple times and consume time.
1921

2022

23+
@unittest.skipIf(os.getenv("NO_NET_ACCESS"), "Test requires Internet access")
2124
class TestPushButtons(TestBatchWidget):
2225
def setUp(self):
2326
super().setUp()

test/asammdf/gui/widgets/batch/test_BatchWidget_Tab_ModifyAndExport.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python
22
import datetime
33
from math import ceil
4+
import os
45
from pathlib import Path
56
from random import randint
67
import unittest
@@ -189,6 +190,7 @@ def test_output_format_MDF(self):
189190
for channel in self.selected_channels:
190191
self.assertIn(channel, mdf_file.channels_db)
191192

193+
@unittest.skipIf(os.getenv("NO_NET_ACCESS"), "Test requires Internet access")
192194
def test_output_format_ASC(self):
193195
"""
194196
When QThreads are running, event-loops needs to be processed.
@@ -579,6 +581,7 @@ def test_output_format_HDF5_1(self):
579581
self.assertIn(channel, hdf5_channels)
580582
np.testing.assert_almost_equal(mdf_channel.samples, hdf5_channel, decimal=3)
581583

584+
@unittest.skipIf(os.getenv("NO_NET_ACCESS"), "Test requires Internet access")
582585
def test_output_format_Parquet_0(self):
583586
"""
584587
When QThreads are running, event-loops needs to be processed.
@@ -621,6 +624,7 @@ def test_output_format_Parquet_0(self):
621624
if np.issubdtype(channel.samples.dtype, np.number): # problematic conversion
622625
np.testing.assert_almost_equal(channel.samples, pandas_tab[name].values, decimal=9)
623626

627+
@unittest.skipIf(os.getenv("NO_NET_ACCESS"), "Test requires Internet access")
624628
def test_output_format_Parquet_1(self):
625629
"""
626630
When QThreads are running, event-loops needs to be processed.

test/test_CAN_bus_logging.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from asammdf import MDF
1313

1414

15+
@unittest.skipIf(os.getenv("NO_NET_ACCESS"), "Test requires Internet access")
1516
class TestCANBusLogging(unittest.TestCase):
1617
tempdir_obd: tempfile.TemporaryDirectory[str]
1718
tempdir_j1939: tempfile.TemporaryDirectory[str]

test/test_mdf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
22
from io import BytesIO
3+
import os
34
from pathlib import Path
45
import random
56
import tempfile
@@ -25,6 +26,7 @@
2526
CHANNEL_LEN = 100000
2627

2728

29+
@unittest.skipIf(os.getenv("NO_NET_ACCESS"), "Test requires Internet access")
2830
class TestMDF(unittest.TestCase):
2931
tempdir_demo: tempfile.TemporaryDirectory[str]
3032
tempdir_array: tempfile.TemporaryDirectory[str]

0 commit comments

Comments
 (0)