Skip to content

Commit

Permalink
Skip all but the failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
soininen committed Sep 11, 2023
1 parent d7399f3 commit ad6a9c7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/test_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"""
Unit tests for the plotting module.
"""

import time
import unittest
from contextlib import contextmanager
from unittest.mock import Mock, MagicMock, patch
Expand Down Expand Up @@ -58,6 +58,7 @@ def setUpClass(cls):

def setUp(self):
print("*** setUp() start ***")
time.sleep(1)
with patch("spinetoolbox.spine_db_editor.widgets.spine_db_editor.SpineDBEditor.restore_ui"), patch(
"spinetoolbox.spine_db_editor.widgets.spine_db_editor.SpineDBEditor.show"
):
Expand Down Expand Up @@ -357,7 +358,6 @@ def test_hidden_x_column_should_disable_it(self):
finally:
plot_widget.deleteLater()

@unittest.skip("This may cause segmentation fault on Ubuntu. Or does it?")
def test_add_to_existing_plot(self):
ts1 = TimeSeriesVariableResolution(["2019-07-10T13:00", "2019-07-10T13:20"], [2.3, 5.0], False, False)
ts2 = TimeSeriesFixedResolution("2019-07-10T13:00", "20m", [3.3, 4.0], False, False)
Expand Down Expand Up @@ -541,6 +541,7 @@ def test_nested_map_containing_time_series(self):
plot_widget.deleteLater()


@unittest.skip("Speeding up tests")
class TestConvertIndexedValueToTree(unittest.TestCase):
def test_time_pattern(self):
pattern = TimePattern(["D1-3", "D4-7"], [1.1, 2.2], index_name="weekdays")
Expand Down Expand Up @@ -602,6 +603,7 @@ def test_map_mixed_dimensions(self):
self.assertEqual(node.content, {"a": expected_map1_tree, "b": 3.3})


@unittest.skip("speeding up")
class TestTurnNodesToXYData(unittest.TestCase):
def test_shallow_tree(self):
node = TreeNode("my_index")
Expand Down Expand Up @@ -679,6 +681,7 @@ def test_take_index_as_y_label(self):
self.assertEqual(xy_data, expected)


@unittest.skip("speeding up tests")
class TestReduceIndexes(unittest.TestCase):
def test_single_shallow_xy_data(self):
data = [XYData([1, 2], [1.1, 2.2], IndexName("my_index", 0), "", [], [])]
Expand Down Expand Up @@ -748,6 +751,7 @@ def test_first_index_not_shared(self):
self.assertEqual(common_indexes, ["shared"])


@unittest.skip("speeding up tests")
class TestCombineDataWithSameIndexes(unittest.TestCase):
def test_not_combined_due_to_different_x_labels(self):
data = [
Expand Down Expand Up @@ -801,6 +805,7 @@ def test_all_same_indexes_combined(self):
self.assertEqual(combined, expected)


@unittest.skip("speeding up tests")
class TestPlotData(unittest.TestCase):
@classmethod
def setUpClass(cls):
Expand Down Expand Up @@ -954,6 +959,7 @@ def test_legend_placement_above_threshold(self):
self.assertEqual(repr(plot_widget.canvas.legend_axes.get_gridspec()), repr(GridSpec(1, 2, width_ratios=[1, 0])))


@unittest.skip("speeding up tests")
class TestRaiseIfIncompatibleX(unittest.TestCase):
def test_data_with_numeric_and_string_x_data_raises(self):
data_list = [
Expand All @@ -977,6 +983,7 @@ def test_data_with_numeric_and_string_x_data_raises(self):
self.assertRaises(PlottingError, raise_if_incompatible_x, data_list)


@unittest.skip("speeding up tests")
class TestAddRowToException(unittest.TestCase):
def test_exception_message_formatted_correctly(self):
row = 23
Expand Down

0 comments on commit ad6a9c7

Please sign in to comment.