@@ -84,10 +84,10 @@ def test_basic(doctree, buildername):
84
84
tree = doctree (source , buildername = buildername )
85
85
(cell ,) = tree .traverse (JupyterCellNode )
86
86
(cellinput , celloutput ) = cell .children
87
- assert cell .attributes ["code_below" ] is False
88
- assert cell .attributes ["hide_code" ] is False
89
- assert cell .attributes ["hide_output" ] is False
90
- assert cellinput .children [0 ]["linenos" ] is False
87
+ assert not cell .attributes ["code_below" ]
88
+ assert not cell .attributes ["hide_code" ]
89
+ assert not cell .attributes ["hide_output" ]
90
+ assert not cellinput .children [0 ]["linenos" ]
91
91
assert cellinput .children [0 ].rawsource .strip () == "2 + 2"
92
92
assert celloutput .children [0 ].rawsource .strip () == "4"
93
93
@@ -101,10 +101,10 @@ def test_basic_old_entrypoint(doctree):
101
101
tree = doctree (source , entrypoint = "jupyter_sphinx.execute" )
102
102
(cell ,) = tree .traverse (JupyterCellNode )
103
103
(cellinput , celloutput ) = cell .children
104
- assert cell .attributes ["code_below" ] is False
105
- assert cell .attributes ["hide_code" ] is False
106
- assert cell .attributes ["hide_output" ] is False
107
- assert cellinput .children [0 ]["linenos" ] is False
104
+ assert not cell .attributes ["code_below" ]
105
+ assert not cell .attributes ["hide_code" ]
106
+ assert not cell .attributes ["hide_output" ]
107
+ assert not cellinput .children [0 ]["linenos" ]
108
108
assert cellinput .children [0 ].rawsource .strip () == "2 + 2"
109
109
assert celloutput .children [0 ].rawsource .strip () == "4"
110
110
@@ -119,7 +119,7 @@ def test_hide_output(doctree):
119
119
tree = doctree (source )
120
120
(cell ,) = tree .traverse (JupyterCellNode )
121
121
(cellinput , celloutput ) = cell .children
122
- assert cell .attributes ["hide_output" ] is True
122
+ assert cell .attributes ["hide_output" ]
123
123
assert len (celloutput .children ) == 0
124
124
assert cellinput .children [0 ].rawsource .strip () == "2 + 2"
125
125
@@ -134,7 +134,7 @@ def test_hide_code(doctree):
134
134
tree = doctree (source )
135
135
(cell ,) = tree .traverse (JupyterCellNode )
136
136
(celloutput ,) = cell .children
137
- assert cell .attributes ["hide_code" ] is True
137
+ assert cell .attributes ["hide_code" ]
138
138
assert len (cell .children ) == 1
139
139
assert celloutput .children [0 ].rawsource .strip () == "4"
140
140
@@ -149,7 +149,7 @@ def test_code_below(doctree):
149
149
tree = doctree (source )
150
150
(cell ,) = tree .traverse (JupyterCellNode )
151
151
(celloutput , cellinput ) = cell .children
152
- assert cell .attributes ["code_below" ] is True
152
+ assert cell .attributes ["code_below" ]
153
153
assert cellinput .children [0 ].rawsource .strip () == "2 + 2"
154
154
assert celloutput .children [0 ].rawsource .strip () == "4"
155
155
@@ -164,7 +164,7 @@ def test_linenos(doctree):
164
164
tree = doctree (source )
165
165
(cell ,) = tree .traverse (JupyterCellNode )
166
166
(cellinput , celloutput ) = cell .children
167
- assert cellinput .children [0 ]["linenos" ] is True
167
+ assert cellinput .children [0 ]["linenos" ]
168
168
assert len (cell .children ) == 2
169
169
assert cellinput .children [0 ].rawsource .strip () == "2 + 2"
170
170
assert celloutput .children [0 ].rawsource .strip () == "4"
@@ -178,7 +178,7 @@ def test_linenos(doctree):
178
178
tree = doctree (source )
179
179
(cell ,) = tree .traverse (JupyterCellNode )
180
180
(celloutput , cellinput ) = cell .children
181
- assert cellinput .children [0 ]["linenos" ] is True
181
+ assert cellinput .children [0 ]["linenos" ]
182
182
183
183
184
184
def test_linenos_conf_option (doctree ):
@@ -454,7 +454,7 @@ def test_thebe_hide_output(doctree):
454
454
tree = doctree (source , thebe_config )
455
455
(cell ,) = tree .traverse (JupyterCellNode )
456
456
(cellinput , celloutput ) = cell .children
457
- assert cell .attributes ["hide_output" ] is True
457
+ assert cell .attributes ["hide_output" ]
458
458
assert len (celloutput .children ) == 0
459
459
460
460
source = cellinput .children [0 ]
@@ -473,12 +473,12 @@ def test_thebe_hide_code(doctree):
473
473
tree = doctree (source , thebe_config )
474
474
(cell ,) = tree .traverse (JupyterCellNode )
475
475
(cellinput , celloutput ) = cell .children
476
- assert cell .attributes ["hide_code" ] is True
476
+ assert cell .attributes ["hide_code" ]
477
477
assert len (cell .children ) == 2
478
478
479
479
source = cellinput .children [0 ]
480
480
assert type (source ) == ThebeSourceNode
481
- assert source .attributes ["hide_code" ] is True
481
+ assert source .attributes ["hide_code" ]
482
482
assert len (source .children ) == 1
483
483
assert source .children [0 ].rawsource .strip () == "2 + 2"
484
484
@@ -498,7 +498,7 @@ def test_thebe_code_below(doctree):
498
498
tree = doctree (source , thebe_config )
499
499
(cell ,) = tree .traverse (JupyterCellNode )
500
500
(cellinput , celloutput ) = cell .children
501
- assert cell .attributes ["code_below" ] is True
501
+ assert cell .attributes ["code_below" ]
502
502
503
503
output = cellinput .children [0 ]
504
504
assert type (output ) is ThebeOutputNode
@@ -509,7 +509,7 @@ def test_thebe_code_below(doctree):
509
509
assert type (source ) is ThebeSourceNode
510
510
assert len (source .children ) == 1
511
511
assert source .children [0 ].rawsource .strip () == "2 + 2"
512
- assert source .attributes ["code_below" ] is True
512
+ assert source .attributes ["code_below" ]
513
513
514
514
515
515
def test_thebe_button_auto (doctree ):
0 commit comments