Skip to content

Commit

Permalink
Use None instead of [] from get_logs (#1250)
Browse files Browse the repository at this point in the history
  • Loading branch information
anders-kiaer authored Dec 15, 2023
1 parent 557d1cf commit 7525fe1
Show file tree
Hide file tree
Showing 25 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion tests/integration_tests/plugin_tests/test_bhp_qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ def test_bhp_qc(_webviz_duo: WebvizComposite, shared_settings: dict) -> None:
)

_webviz_duo.start_server(plugin)
assert _webviz_duo.get_logs() == []
assert _webviz_duo.get_logs() is None
2 changes: 1 addition & 1 deletion tests/integration_tests/plugin_tests/test_history_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ def test_history_match(dash_duo, app, testdata_folder, shared_settings) -> None:
)
app.layout = plugin.layout
dash_duo.start_server(app)
assert dash_duo.get_logs() == []
assert dash_duo.get_logs() is None
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ def test_line_plotter_fmu(dash_duo, app, testdata_folder, shared_settings) -> No
)
app.layout = plugin.layout
dash_duo.start_server(app)
assert dash_duo.get_logs() == []
assert dash_duo.get_logs() is None
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_parameter_analysis(
_webviz_duo.start_server(plugin)

logs = []
for log in _webviz_duo.get_logs():
for log in _webviz_duo.get_logs() or []:
if "dash_renderer" in log.get("message"):
warnings.warn(log.get("message"))
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ def test_parameter_correlation(_webviz_duo: WebvizComposite, shared_settings) ->
"paracorr", "settings", "shared-ensemble"
)
_webviz_duo.wait_for_contains_text(my_component_id, "iter-0")
assert _webviz_duo.get_logs() == []
assert _webviz_duo.get_logs() is None
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ def test_parameter_distribution(dash_duo, app, shared_settings) -> None:
)
app.layout = plugin.layout
dash_duo.start_server(app)
assert dash_duo.get_logs() == []
assert dash_duo.get_logs() is None
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ def test_parameter_parallel_coordinates(dash_duo, app, shared_settings) -> None:
)
app.layout = plugin.layout
dash_duo.start_server(app)
assert dash_duo.get_logs() == []
assert dash_duo.get_logs() is None
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def test_parameter_response_correlation(dash_duo, app, shared_settings) -> None:
)
app.layout = plugin.layout
dash_duo.start_server(app)
assert dash_duo.get_logs() == []
assert dash_duo.get_logs() is None
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_property_statistics(dash_duo, app, shared_settings) -> None:
app.layout = plugin.layout
dash_duo.start_server(app)
logs = []
for log in dash_duo.get_logs():
for log in dash_duo.get_logs() or []:
if "dash_renderer" in log.get("message"):
warnings.warn(log.get("message"))
else:
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/plugin_tests/test_pvt_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def test_pvt_plot(_webviz_duo: WebvizComposite, shared_settings: dict) -> None:

_webviz_duo.start_server(plugin)

assert _webviz_duo.get_logs() == []
assert _webviz_duo.get_logs() is None
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ def test_relative_permeability(dash_duo, app, shared_settings) -> None:
)
app.layout = plugin.layout
dash_duo.start_server(app)
assert dash_duo.get_logs() == []
assert dash_duo.get_logs() is None
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_reservoir_simulation_timeseries(
dash_duo.start_server(app)

logs = []
for log in dash_duo.get_logs():
for log in dash_duo.get_logs() or []:
if "dash_renderer" in log.get("message"):
warnings.warn(log.get("message"))
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ def test_reservoir_simulation_timeseries_onebyone(
)
app.layout = plugin.layout
dash_duo.start_server(app)
assert dash_duo.get_logs() == []
assert dash_duo.get_logs() is None
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ def test_reservoir_simulation_timeseries_regional(
)
app.layout = plugin.layout
dash_duo.start_server(app)
assert dash_duo.get_logs() == []
assert dash_duo.get_logs() is None
2 changes: 1 addition & 1 deletion tests/integration_tests/plugin_tests/test_rft_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ def test_rft_plotter(
"map-view", "map-settings", "map-ensemble"
)
_webviz_duo.wait_for_contains_text(my_component_id, "iter-0")
assert _webviz_duo.get_logs() == []
assert _webviz_duo.get_logs() is None
2 changes: 1 addition & 1 deletion tests/integration_tests/plugin_tests/test_segy_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ def test_segy_viewer(dash_duo, app, shared_settings, testdata_folder) -> None:
)
app.layout = plugin.layout
dash_duo.start_server(app)
assert dash_duo.get_logs() == []
assert dash_duo.get_logs() is None
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_simulation_timeseries_onebyone(
)
_webviz_duo.start_server(plugin)
logs = []
for log in _webviz_duo.get_logs():
for log in _webviz_duo.get_logs() or []:
if "dash_renderer" in log.get("message"):
warnings.warn(log.get("message"))
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def test_default_configuration(dash_duo, app, testdata_folder) -> None:
real_selector = dash_duo.wait_for_element_by_id(real_uuid)
assert real_selector.text.splitlines() == ["0", "1"]

assert dash_duo.get_logs() == [], "browser console should contain no error"
assert dash_duo.get_logs() is None, "browser console should contain no error"


def test_full_configuration(dash_duo, app, testdata_folder) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ def test_surface_viewer_fmu(dash_duo, app, shared_settings, testdata_folder) ->
)
app.layout = plugin.layout
dash_duo.start_server(app)
assert dash_duo.get_logs() == []
assert dash_duo.get_logs() is None
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ def test_surface_with_grid_crosssection(
)
app.layout = plugin.layout
dash_duo.start_server(app)
assert dash_duo.get_logs() == []
assert dash_duo.get_logs() is None
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ def test_surface_with_seismic_crosssection(
)
app.layout = plugin.layout
dash_duo.start_server(app)
assert dash_duo.get_logs() == []
assert dash_duo.get_logs() is None
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ def test_tornado_plotter_fmu(dash_duo, app, shared_settings) -> None:
)
app.layout = plugin.layout
dash_duo.start_server(app)
assert dash_duo.get_logs() == []
assert dash_duo.get_logs() is None
2 changes: 1 addition & 1 deletion tests/integration_tests/plugin_tests/test_vfp_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ def test_vfp_analysis(_webviz_duo: WebvizComposite, shared_settings: dict) -> No

_webviz_duo.start_server(plugin)

assert _webviz_duo.get_logs() == []
assert _webviz_duo.get_logs() is None
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_volumetrics_no_sens(dash_duo, app, shared_settings) -> None:
app.layout = plugin.layout
dash_duo.start_server(app)
logs = []
for log in dash_duo.get_logs():
for log in dash_duo.get_logs() or []:
if "dash_renderer" in log.get("message"):
warnings.warn(log.get("message"))
else:
Expand All @@ -30,7 +30,7 @@ def test_volumetrics_sens(dash_duo, app, shared_settings) -> None:
app.layout = plugin.layout
dash_duo.start_server(app)
logs = []
for log in dash_duo.get_logs():
for log in dash_duo.get_logs() or []:
if "dash_renderer" in log.get("message"):
warnings.warn(log.get("message"))
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ def test_well_log_viewer(dash_duo, app, testdata_folder) -> None:
)
app.layout = plugin.layout
dash_duo.start_server(app)
assert dash_duo.get_logs() == []
assert dash_duo.get_logs() is None

0 comments on commit 7525fe1

Please sign in to comment.