Skip to content

Commit 366acca

Browse files
committed
make jupytext notebooks compatible with pytest
* rename functions in the notebook files so they are not assumed to be tests by pytest
1 parent ca3e017 commit 366acca

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

tests/notebooks/widget_check_registry.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
import scwidgets
2121
from scwidgets.check import CheckRegistry
2222

23-
sys.path.insert(0, os.path.abspath(".."))
24-
from test_check import mock_checkable_widget # noqa: E402
25-
from test_check import single_param_check # noqa: E402
23+
sys.path.insert(0, os.path.abspath("../.."))
24+
from tests.test_check import mock_checkable_widget # noqa: E402
25+
from tests.test_check import single_param_check # noqa: E402
2626

2727
# -
2828

2929
scwidgets.get_css_style()
3030

3131

32-
def test_check_registry(use_fingerprint, failing, buggy):
32+
def create_check_registry(use_fingerprint, failing, buggy):
3333
check_registry = CheckRegistry()
3434
checkable_widget = mock_checkable_widget(check_registry)
3535

@@ -52,16 +52,16 @@ def test_check_registry(use_fingerprint, failing, buggy):
5252
# Test if CheckRegistry shows correct output
5353

5454
# Test 1.1
55-
test_check_registry(use_fingerprint=False, failing=False, buggy=False)
55+
create_check_registry(use_fingerprint=False, failing=False, buggy=False)
5656

5757
# Test 1.2
58-
test_check_registry(use_fingerprint=True, failing=False, buggy=False)
58+
create_check_registry(use_fingerprint=True, failing=False, buggy=False)
5959

6060
# Test 1.3
61-
test_check_registry(use_fingerprint=False, failing=True, buggy=False)
61+
create_check_registry(use_fingerprint=False, failing=True, buggy=False)
6262

6363
# Test 1.4
64-
test_check_registry(use_fingerprint=True, failing=True, buggy=False)
64+
create_check_registry(use_fingerprint=True, failing=True, buggy=False)
6565

6666
# Test 1.5
67-
test_check_registry(use_fingerprint=False, failing=False, buggy=True)
67+
create_check_registry(use_fingerprint=False, failing=False, buggy=True)

tests/notebooks/widgets_cue.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,26 @@
2727
# Check if CueBox shows cue when changed
2828

2929

30-
def test_1(CueBoxClass, cued):
30+
def create_cue_box(CueBoxClass, cued):
3131
text_input = Text("Text")
3232
cued_text_input = CueBoxClass(text_input, cued=cued)
3333
return cued_text_input
3434

3535

3636
# Test 1.1
37-
test_1(CueBox, True)
37+
create_cue_box(CueBox, True)
3838

3939
# Test 1.2
40-
test_1(CueBox, False)
40+
create_cue_box(CueBox, False)
4141

4242
# Test 1.3
43-
test_1(SaveCueBox, False)
43+
create_cue_box(SaveCueBox, False)
4444

4545
# Test 1.4
46-
test_1(CheckCueBox, False)
46+
create_cue_box(CheckCueBox, False)
4747

4848
# Test 1.5
49-
test_1(UpdateCueBox, False)
49+
create_cue_box(UpdateCueBox, False)
5050

5151
# Test 2:
5252
# -------

0 commit comments

Comments
 (0)