[Change] use HidePrints to clean output of test results
This commit is contained in:
parent
6ae5a213d1
commit
f5c1fea159
@ -3,6 +3,7 @@ import os
|
|||||||
|
|
||||||
from obspy import UTCDateTime
|
from obspy import UTCDateTime
|
||||||
from pylot.core.util.dataprocessing import Metadata
|
from pylot.core.util.dataprocessing import Metadata
|
||||||
|
from tests.utils import HidePrints
|
||||||
|
|
||||||
class TestMetadata(unittest.TestCase):
|
class TestMetadata(unittest.TestCase):
|
||||||
|
|
||||||
@ -19,7 +20,8 @@ class TestMetadata(unittest.TestCase):
|
|||||||
}
|
}
|
||||||
result = {}
|
result = {}
|
||||||
for channel in ('Z', 'N', 'E'):
|
for channel in ('Z', 'N', 'E'):
|
||||||
coords = self.m.get_coordinates(self.station_id+channel, time=self.time)
|
with HidePrints():
|
||||||
|
coords = self.m.get_coordinates(self.station_id+channel, time=self.time)
|
||||||
result[channel] = coords
|
result[channel] = coords
|
||||||
self.assertDictEqual(result[channel], expected[channel])
|
self.assertDictEqual(result[channel], expected[channel])
|
||||||
|
|
||||||
@ -30,7 +32,8 @@ class TestMetadata(unittest.TestCase):
|
|||||||
}
|
}
|
||||||
result = {}
|
result = {}
|
||||||
for channel in ('Z', 'N', 'E'):
|
for channel in ('Z', 'N', 'E'):
|
||||||
coords = self.m.get_coordinates(self.station_id+channel)
|
with HidePrints():
|
||||||
|
coords = self.m.get_coordinates(self.station_id+channel)
|
||||||
result[channel] = coords
|
result[channel] = coords
|
||||||
self.assertDictEqual(result[channel], expected[channel])
|
self.assertDictEqual(result[channel], expected[channel])
|
||||||
|
|
||||||
@ -107,7 +110,8 @@ class TestMetadataRemoval(unittest.TestCase):
|
|||||||
exist in the instance."""
|
exist in the instance."""
|
||||||
# add multiple inventories
|
# add multiple inventories
|
||||||
self.m.add_inventory(self.metadata_folders[0])
|
self.m.add_inventory(self.metadata_folders[0])
|
||||||
self.m.remove_inventory('metadata_not_existing')
|
with HidePrints():
|
||||||
|
self.m.remove_inventory('metadata_not_existing')
|
||||||
self.assertIn(self.metadata_folders[0], self.m.inventories)
|
self.assertIn(self.metadata_folders[0], self.m.inventories)
|
||||||
|
|
||||||
def isEmpty(self, metadata):
|
def isEmpty(self, metadata):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user