Skip to content

Commit 0e0774f

Browse files
style: run black and prettier on the new #2462 tests
Black: collapse two click() chains that fit on one line and drop a trailing blank line. Prettier: reformat the new Mocha test file to match renderer style. Flake8 W391 clears once the trailing blank lines go. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2937293 commit 0e0774f

3 files changed

Lines changed: 18 additions & 38 deletions

File tree

dash/dash-renderer/tests/dependencies.test.js

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import {expect} from 'chai';
22
import {beforeEach, describe, it} from 'mocha';
3-
import {
4-
computeGraphs,
5-
getAnyVals
6-
} from '../src/actions/dependencies';
3+
import {computeGraphs, getAnyVals} from '../src/actions/dependencies';
74
import {getCallbacksByInput} from '../src/actions/dependencies_ts';
85
import {EventEmitter} from '../src/actions/utils';
96

@@ -44,9 +41,7 @@ describe('dependencies — MATCH validation (#2462)', () => {
4441
[
4542
{
4643
output: 'out.children',
47-
inputs: [
48-
{id: '{"id":["MATCH"]}', property: 'n_clicks'}
49-
],
44+
inputs: [{id: '{"id":["MATCH"]}', property: 'n_clicks'}],
5045
state: [],
5146
no_output: false
5247
}
@@ -62,9 +57,7 @@ describe('dependencies — MATCH validation (#2462)', () => {
6257
[
6358
{
6459
output: '',
65-
inputs: [
66-
{id: '{"id":["MATCH"]}', property: 'n_clicks'}
67-
],
60+
inputs: [{id: '{"id":["MATCH"]}', property: 'n_clicks'}],
6861
state: [],
6962
no_output: true
7063
}
@@ -80,12 +73,8 @@ describe('dependencies — MATCH validation (#2462)', () => {
8073
[
8174
{
8275
output: 'out.children',
83-
inputs: [
84-
{id: '{"id":["MATCH"]}', property: 'n_clicks'}
85-
],
86-
state: [
87-
{id: '{"id":["MATCH"]}', property: 'id'}
88-
],
76+
inputs: [{id: '{"id":["MATCH"]}', property: 'n_clicks'}],
77+
state: [{id: '{"id":["MATCH"]}', property: 'id'}],
8978
no_output: false
9079
}
9180
],
@@ -101,7 +90,10 @@ describe('dependencies — MATCH validation (#2462)', () => {
10190
{
10291
output: '{"id":["ALL"]}.children',
10392
inputs: [
104-
{id: '{"type":"btn","idx":["MATCH"]}', property: 'n_clicks'}
93+
{
94+
id: '{"type":"btn","idx":["MATCH"]}',
95+
property: 'n_clicks'
96+
}
10597
],
10698
state: [],
10799
no_output: false
@@ -118,9 +110,7 @@ describe('dependencies — MATCH validation (#2462)', () => {
118110
[
119111
{
120112
output: 'out.children',
121-
inputs: [
122-
{id: '{"id":["ALLSMALLER"]}', property: 'value'}
123-
],
113+
inputs: [{id: '{"id":["ALLSMALLER"]}', property: 'value'}],
124114
state: [],
125115
no_output: false
126116
}
@@ -139,9 +129,7 @@ describe('dependencies — MATCH validation (#2462)', () => {
139129
[
140130
{
141131
output: '{"a":["MATCH"]}.children',
142-
inputs: [
143-
{id: '{"b":["MATCH"]}', property: 'n_clicks'}
144-
],
132+
inputs: [{id: '{"b":["MATCH"]}', property: 'n_clicks'}],
145133
state: [],
146134
no_output: false
147135
}
@@ -173,7 +161,9 @@ describe('dependencies — MATCH validation (#2462)', () => {
173161
config
174162
);
175163
const msgs = errors.map(e => e.message);
176-
expect(msgs).to.include('Mismatched `MATCH` wildcards across `Output`s');
164+
expect(msgs).to.include(
165+
'Mismatched `MATCH` wildcards across `Output`s'
166+
);
177167
});
178168
});
179169

@@ -186,9 +176,7 @@ describe('dependencies — MATCH trigger resolvedId (#2462)', () => {
186176
[
187177
{
188178
output: 'out.children',
189-
inputs: [
190-
{id: '{"id":["MATCH"]}', property: 'n_clicks'}
191-
],
179+
inputs: [{id: '{"id":["MATCH"]}', property: 'n_clicks'}],
192180
state: [],
193181
no_output: false
194182
}
@@ -208,9 +196,7 @@ describe('dependencies — MATCH trigger resolvedId (#2462)', () => {
208196
[
209197
{
210198
output: 'out.children',
211-
inputs: [
212-
{id: '{"id":["MATCH"]}', property: 'n_clicks'}
213-
],
199+
inputs: [{id: '{"id":["MATCH"]}', property: 'n_clicks'}],
214200
state: [],
215201
no_output: false
216202
}

tests/integration/callbacks/test_wildcards.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -704,15 +704,10 @@ def announce(_, id_):
704704

705705
dash_duo.wait_for_text_to_equal("#out", "initial")
706706

707-
dash_duo.find_element(
708-
'[id=\\{\\"index\\"\\:1\\,\\"type\\"\\:\\"btn\\"\\}]'
709-
).click()
707+
dash_duo.find_element('[id=\\{\\"index\\"\\:1\\,\\"type\\"\\:\\"btn\\"\\}]').click()
710708
dash_duo.wait_for_text_to_equal("#out", "clicked index=1")
711709

712-
dash_duo.find_element(
713-
'[id=\\{\\"index\\"\\:2\\,\\"type\\"\\:\\"btn\\"\\}]'
714-
).click()
710+
dash_duo.find_element('[id=\\{\\"index\\"\\:2\\,\\"type\\"\\:\\"btn\\"\\}]').click()
715711
dash_duo.wait_for_text_to_equal("#out", "clicked index=2")
716712

717713
assert dash_duo.get_logs() == []
718-

tests/integration/devtools/test_callback_validation.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,4 +874,3 @@ def c(_):
874874
wait.until(lambda: ~dash_duo.redux_state_is_loading, 2)
875875
dash_duo.wait_for_no_elements(dash_duo.devtools_error_count_locator)
876876
assert dash_duo.get_logs() == []
877-

0 commit comments

Comments
 (0)