From 7525fe1f71899aac38e882cf005cfb67aaaa2fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Fredrik=20Ki=C3=A6r?= <31612826+anders-kiaer@users.noreply.github.com> Date: Fri, 15 Dec 2023 13:27:43 +0100 Subject: [PATCH] Use `None` instead of `[]` from `get_logs` (#1250) --- tests/integration_tests/plugin_tests/test_bhp_qc.py | 2 +- tests/integration_tests/plugin_tests/test_history_match.py | 2 +- tests/integration_tests/plugin_tests/test_line_plotter_fmu.py | 2 +- .../integration_tests/plugin_tests/test_parameter_analysis.py | 2 +- .../plugin_tests/test_parameter_correlation.py | 2 +- .../plugin_tests/test_parameter_distribution.py | 2 +- .../plugin_tests/test_parameter_parallel_coordinates.py | 2 +- .../plugin_tests/test_parameter_response_correlation.py | 2 +- .../plugin_tests/test_property_statistics.py | 2 +- tests/integration_tests/plugin_tests/test_pvt_plot.py | 2 +- .../plugin_tests/test_relative_permeability.py | 2 +- .../plugin_tests/test_reservoir_simulation_timeseries.py | 2 +- .../test_reservoir_simulation_timeseries_onebyone.py | 2 +- .../test_reservoir_simulation_timeseries_regional.py | 2 +- tests/integration_tests/plugin_tests/test_rft_plotter.py | 2 +- tests/integration_tests/plugin_tests/test_segy_viewer.py | 2 +- .../plugin_tests/test_simulation_timeseries_onebyone.py | 2 +- .../plugin_tests/test_structural_uncertainty.py | 2 +- .../integration_tests/plugin_tests/test_surface_viewer_fmu.py | 2 +- .../plugin_tests/test_surface_with_grid_crossection.py | 2 +- .../plugin_tests/test_surface_with_seismic_crossection.py | 2 +- .../plugin_tests/test_tornado_plotter_fmu.py | 2 +- tests/integration_tests/plugin_tests/test_vfp_analysis.py | 2 +- .../plugin_tests/test_volumetric_analysis.py | 4 ++-- tests/integration_tests/plugin_tests/test_well_log_viewer.py | 2 +- 25 files changed, 26 insertions(+), 26 deletions(-) diff --git a/tests/integration_tests/plugin_tests/test_bhp_qc.py b/tests/integration_tests/plugin_tests/test_bhp_qc.py index 141dccfb7..e4ed0898a 100644 --- a/tests/integration_tests/plugin_tests/test_bhp_qc.py +++ b/tests/integration_tests/plugin_tests/test_bhp_qc.py @@ -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 diff --git a/tests/integration_tests/plugin_tests/test_history_match.py b/tests/integration_tests/plugin_tests/test_history_match.py index 676686e76..3d52daa8c 100644 --- a/tests/integration_tests/plugin_tests/test_history_match.py +++ b/tests/integration_tests/plugin_tests/test_history_match.py @@ -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 diff --git a/tests/integration_tests/plugin_tests/test_line_plotter_fmu.py b/tests/integration_tests/plugin_tests/test_line_plotter_fmu.py index f9c2f41bd..2f743389a 100644 --- a/tests/integration_tests/plugin_tests/test_line_plotter_fmu.py +++ b/tests/integration_tests/plugin_tests/test_line_plotter_fmu.py @@ -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 diff --git a/tests/integration_tests/plugin_tests/test_parameter_analysis.py b/tests/integration_tests/plugin_tests/test_parameter_analysis.py index 3d641d98c..db20565c5 100644 --- a/tests/integration_tests/plugin_tests/test_parameter_analysis.py +++ b/tests/integration_tests/plugin_tests/test_parameter_analysis.py @@ -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: diff --git a/tests/integration_tests/plugin_tests/test_parameter_correlation.py b/tests/integration_tests/plugin_tests/test_parameter_correlation.py index a1a6a45fd..bedfc618d 100644 --- a/tests/integration_tests/plugin_tests/test_parameter_correlation.py +++ b/tests/integration_tests/plugin_tests/test_parameter_correlation.py @@ -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 diff --git a/tests/integration_tests/plugin_tests/test_parameter_distribution.py b/tests/integration_tests/plugin_tests/test_parameter_distribution.py index 0f70dbe24..337fc5bf4 100644 --- a/tests/integration_tests/plugin_tests/test_parameter_distribution.py +++ b/tests/integration_tests/plugin_tests/test_parameter_distribution.py @@ -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 diff --git a/tests/integration_tests/plugin_tests/test_parameter_parallel_coordinates.py b/tests/integration_tests/plugin_tests/test_parameter_parallel_coordinates.py index ca41aa4c1..a26faeda5 100644 --- a/tests/integration_tests/plugin_tests/test_parameter_parallel_coordinates.py +++ b/tests/integration_tests/plugin_tests/test_parameter_parallel_coordinates.py @@ -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 diff --git a/tests/integration_tests/plugin_tests/test_parameter_response_correlation.py b/tests/integration_tests/plugin_tests/test_parameter_response_correlation.py index 90ecd12c7..36e6895b7 100644 --- a/tests/integration_tests/plugin_tests/test_parameter_response_correlation.py +++ b/tests/integration_tests/plugin_tests/test_parameter_response_correlation.py @@ -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 diff --git a/tests/integration_tests/plugin_tests/test_property_statistics.py b/tests/integration_tests/plugin_tests/test_property_statistics.py index 0e4c16a60..4fc314ade 100644 --- a/tests/integration_tests/plugin_tests/test_property_statistics.py +++ b/tests/integration_tests/plugin_tests/test_property_statistics.py @@ -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: diff --git a/tests/integration_tests/plugin_tests/test_pvt_plot.py b/tests/integration_tests/plugin_tests/test_pvt_plot.py index e5d63080f..511f793af 100644 --- a/tests/integration_tests/plugin_tests/test_pvt_plot.py +++ b/tests/integration_tests/plugin_tests/test_pvt_plot.py @@ -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 diff --git a/tests/integration_tests/plugin_tests/test_relative_permeability.py b/tests/integration_tests/plugin_tests/test_relative_permeability.py index 968ce033e..7865579e6 100644 --- a/tests/integration_tests/plugin_tests/test_relative_permeability.py +++ b/tests/integration_tests/plugin_tests/test_relative_permeability.py @@ -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 diff --git a/tests/integration_tests/plugin_tests/test_reservoir_simulation_timeseries.py b/tests/integration_tests/plugin_tests/test_reservoir_simulation_timeseries.py index 172d9bb6b..3ff1481b2 100644 --- a/tests/integration_tests/plugin_tests/test_reservoir_simulation_timeseries.py +++ b/tests/integration_tests/plugin_tests/test_reservoir_simulation_timeseries.py @@ -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: diff --git a/tests/integration_tests/plugin_tests/test_reservoir_simulation_timeseries_onebyone.py b/tests/integration_tests/plugin_tests/test_reservoir_simulation_timeseries_onebyone.py index 1a5828b47..ec24a7bac 100644 --- a/tests/integration_tests/plugin_tests/test_reservoir_simulation_timeseries_onebyone.py +++ b/tests/integration_tests/plugin_tests/test_reservoir_simulation_timeseries_onebyone.py @@ -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 diff --git a/tests/integration_tests/plugin_tests/test_reservoir_simulation_timeseries_regional.py b/tests/integration_tests/plugin_tests/test_reservoir_simulation_timeseries_regional.py index fe646be35..831d1a7f0 100644 --- a/tests/integration_tests/plugin_tests/test_reservoir_simulation_timeseries_regional.py +++ b/tests/integration_tests/plugin_tests/test_reservoir_simulation_timeseries_regional.py @@ -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 diff --git a/tests/integration_tests/plugin_tests/test_rft_plotter.py b/tests/integration_tests/plugin_tests/test_rft_plotter.py index 94848b283..c3e424c3c 100644 --- a/tests/integration_tests/plugin_tests/test_rft_plotter.py +++ b/tests/integration_tests/plugin_tests/test_rft_plotter.py @@ -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 diff --git a/tests/integration_tests/plugin_tests/test_segy_viewer.py b/tests/integration_tests/plugin_tests/test_segy_viewer.py index 43dfd145d..3365eb462 100644 --- a/tests/integration_tests/plugin_tests/test_segy_viewer.py +++ b/tests/integration_tests/plugin_tests/test_segy_viewer.py @@ -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 diff --git a/tests/integration_tests/plugin_tests/test_simulation_timeseries_onebyone.py b/tests/integration_tests/plugin_tests/test_simulation_timeseries_onebyone.py index 5c4f23344..644f972da 100644 --- a/tests/integration_tests/plugin_tests/test_simulation_timeseries_onebyone.py +++ b/tests/integration_tests/plugin_tests/test_simulation_timeseries_onebyone.py @@ -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: diff --git a/tests/integration_tests/plugin_tests/test_structural_uncertainty.py b/tests/integration_tests/plugin_tests/test_structural_uncertainty.py index 95d979657..2b8ff16e1 100644 --- a/tests/integration_tests/plugin_tests/test_structural_uncertainty.py +++ b/tests/integration_tests/plugin_tests/test_structural_uncertainty.py @@ -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: diff --git a/tests/integration_tests/plugin_tests/test_surface_viewer_fmu.py b/tests/integration_tests/plugin_tests/test_surface_viewer_fmu.py index 089177cf7..e7f8d2dbb 100644 --- a/tests/integration_tests/plugin_tests/test_surface_viewer_fmu.py +++ b/tests/integration_tests/plugin_tests/test_surface_viewer_fmu.py @@ -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 diff --git a/tests/integration_tests/plugin_tests/test_surface_with_grid_crossection.py b/tests/integration_tests/plugin_tests/test_surface_with_grid_crossection.py index 9f3978f51..791a61d2e 100644 --- a/tests/integration_tests/plugin_tests/test_surface_with_grid_crossection.py +++ b/tests/integration_tests/plugin_tests/test_surface_with_grid_crossection.py @@ -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 diff --git a/tests/integration_tests/plugin_tests/test_surface_with_seismic_crossection.py b/tests/integration_tests/plugin_tests/test_surface_with_seismic_crossection.py index e3046f4c0..e2383df83 100644 --- a/tests/integration_tests/plugin_tests/test_surface_with_seismic_crossection.py +++ b/tests/integration_tests/plugin_tests/test_surface_with_seismic_crossection.py @@ -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 diff --git a/tests/integration_tests/plugin_tests/test_tornado_plotter_fmu.py b/tests/integration_tests/plugin_tests/test_tornado_plotter_fmu.py index 008da7ee1..ef2a73125 100644 --- a/tests/integration_tests/plugin_tests/test_tornado_plotter_fmu.py +++ b/tests/integration_tests/plugin_tests/test_tornado_plotter_fmu.py @@ -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 diff --git a/tests/integration_tests/plugin_tests/test_vfp_analysis.py b/tests/integration_tests/plugin_tests/test_vfp_analysis.py index fb144fee7..4facfa069 100644 --- a/tests/integration_tests/plugin_tests/test_vfp_analysis.py +++ b/tests/integration_tests/plugin_tests/test_vfp_analysis.py @@ -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 diff --git a/tests/integration_tests/plugin_tests/test_volumetric_analysis.py b/tests/integration_tests/plugin_tests/test_volumetric_analysis.py index e163be178..6846bc6d6 100644 --- a/tests/integration_tests/plugin_tests/test_volumetric_analysis.py +++ b/tests/integration_tests/plugin_tests/test_volumetric_analysis.py @@ -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: @@ -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: diff --git a/tests/integration_tests/plugin_tests/test_well_log_viewer.py b/tests/integration_tests/plugin_tests/test_well_log_viewer.py index c6445f09e..94bed1ad8 100644 --- a/tests/integration_tests/plugin_tests/test_well_log_viewer.py +++ b/tests/integration_tests/plugin_tests/test_well_log_viewer.py @@ -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