matlab-proxy 0.24.2__py3-none-any.whl → 0.25.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of matlab-proxy might be problematic. Click here for more details.

@@ -43,6 +43,7 @@ def sample_settings_fixture(tmp_path):
43
43
  "warnings": [],
44
44
  "matlab_config_file": tmp_file,
45
45
  "is_xvfb_available": True,
46
+ "is_windowmanager_available": True,
46
47
  "mwi_server_url": "dummy",
47
48
  "mwi_logs_root_dir": Path(settings.get_mwi_config_folder(dev=True)),
48
49
  "app_port": 12345,
@@ -55,12 +56,12 @@ def sample_settings_fixture(tmp_path):
55
56
 
56
57
 
57
58
  @pytest.fixture
58
- def app_state_fixture(sample_settings_fixture, loop):
59
+ def app_state_fixture(sample_settings_fixture, event_loop):
59
60
  """A pytest fixture which returns an instance of AppState class with no errors.
60
61
 
61
62
  Args:
62
63
  sample_settings_fixture (dict): A dictionary of sample settings to be used by
63
- loop : A pytest builtin fixture
64
+ event_loop : A pytest builtin fixture
64
65
 
65
66
  Returns:
66
67
  AppState: An object of the AppState class
@@ -71,7 +72,7 @@ def app_state_fixture(sample_settings_fixture, loop):
71
72
 
72
73
  yield app_state
73
74
 
74
- loop.run_until_complete(app_state.stop_server_tasks())
75
+ event_loop.run_until_complete(app_state.stop_server_tasks())
75
76
 
76
77
 
77
78
  @pytest.fixture
@@ -108,13 +109,13 @@ def app_state_with_token_auth_fixture(
108
109
 
109
110
 
110
111
  @pytest.fixture
111
- def mocker_os_patching_fixture(mocker, platform, loop):
112
+ def mocker_os_patching_fixture(mocker, platform, event_loop):
112
113
  """A pytest fixture which patches the is_* functions in system.py module
113
114
 
114
115
  Args:
115
116
  mocker : Built in pytest fixture
116
117
  platform (str): A string representing "windows", "linux" or "mac"
117
- loop : A pytest builtin fixture
118
+ event_loop : A pytest builtin fixture
118
119
 
119
120
  Returns:
120
121
  mocker: Built in pytest fixture with patched calls to system.py module.
@@ -123,7 +124,7 @@ def mocker_os_patching_fixture(mocker, platform, loop):
123
124
  mocker.patch("matlab_proxy.app_state.system.is_windows", return_value=False)
124
125
  mocker.patch("matlab_proxy.app_state.system.is_mac", return_value=False)
125
126
  mocker.patch("matlab_proxy.app_state.system.is_posix", return_value=False)
126
- mocker.patch("matlab_proxy.app_state.util.get_event_loop", return_value=loop)
127
+ mocker.patch("matlab_proxy.app_state.util.get_event_loop", return_value=event_loop)
127
128
 
128
129
  if platform == "linux":
129
130
  mocker.patch("matlab_proxy.app_state.system.is_linux", return_value=True)
@@ -820,7 +821,7 @@ async def test_decrement_timer_runs_out(sample_settings_fixture, mocker):
820
821
  app_state.processes = {"matlab": None, "xvfb": None}
821
822
  app_state.licensing = {"type": "existing_license"}
822
823
 
823
- # mock util.get_event_loop() to return a new loop for the test to assert
824
+ # mock util.get_event_loop() to return a new event_loop for the test to assert
824
825
  mock_loop = asyncio.new_event_loop()
825
826
  mocker.patch("matlab_proxy.app_state.util.get_event_loop", return_value=mock_loop)
826
827
 
@@ -1,4 +1,4 @@
1
- # Copyright 2020-2022 The MathWorks, Inc.
1
+ # Copyright 2020-2025 The MathWorks, Inc.
2
2
 
3
3
  import os
4
4
  import shutil
@@ -126,7 +126,7 @@ def mock_settings_get_fixture(mocker):
126
126
 
127
127
  @pytest.fixture(name="test_server")
128
128
  def test_server_fixture(
129
- loop,
129
+ event_loop,
130
130
  aiohttp_client,
131
131
  build_frontend,
132
132
  matlab_port_setup,
@@ -140,7 +140,7 @@ def test_server_fixture(
140
140
  This fixture 'initializes' the test server with different constraints from the test server in test_app.py
141
141
 
142
142
  Args:
143
- loop : Event Loop
143
+ event_loop : Event loop
144
144
  aiohttp_client : A built-in pytest fixture
145
145
  build_frontend: Pytest fixture which generates the directory structure of static files with some placeholder content
146
146
  matlab_port_setup: Pytest fixture which monkeypatches 'MWI_DEV' env to False. This is required for the test_server to add static content
@@ -150,7 +150,7 @@ def test_server_fixture(
150
150
  [aiohttp_client]: A aiohttp_client to send HTTP requests.
151
151
  """
152
152
 
153
- with FakeServer(loop, aiohttp_client) as test_server:
153
+ with FakeServer(event_loop, aiohttp_client) as test_server:
154
154
  yield test_server
155
155
 
156
156
 
@@ -543,21 +543,6 @@ def test_get_matlab_cmd_windows(mocker):
543
543
  assert ".exe" in cmd[0] # Assert .exe suffix in matlab_executable_path
544
544
 
545
545
 
546
- def test_get_matlab_cmd_with_mpa_flags(mocker):
547
- # Arrange
548
- mocker.patch(
549
- "matlab_proxy.settings.mwi_env.Experimental.is_mpa_enabled", return_value=True
550
- )
551
- matlab_executable_path = "/path/to/matlab"
552
- code_to_execute = "disp('Test')"
553
-
554
- # Act
555
- cmd = settings._get_matlab_cmd(matlab_executable_path, code_to_execute, None)
556
-
557
- # Assert
558
- assert all(mpa_flag in cmd for mpa_flag in mwi_env.Experimental.get_mpa_flags())
559
-
560
-
561
546
  def test_get_matlab_cmd_with_startup_profiling(mocker):
562
547
  # Arrange
563
548
  mocker.patch("matlab_proxy.settings.system.is_windows", return_value=False)
@@ -1,4 +1,4 @@
1
- # Copyright 2023-2024 The MathWorks, Inc.
1
+ # Copyright 2023-2025 The MathWorks, Inc.
2
2
 
3
3
  import pytest
4
4
  from aiohttp import web
@@ -90,7 +90,7 @@ async def fake_endpoint(request):
90
90
 
91
91
  @pytest.fixture
92
92
  def fake_server_with_auth_enabled(
93
- loop, aiohttp_client, monkeypatch, get_custom_auth_token_str
93
+ event_loop, aiohttp_client, monkeypatch, get_custom_auth_token_str
94
94
  ):
95
95
  auth_token = get_custom_auth_token_str
96
96
  auth_enablement = "True"
@@ -120,7 +120,7 @@ def fake_server_with_auth_enabled(
120
120
  aiohttp_session_setup(
121
121
  app, EncryptedCookieStorage(f, cookie_name="matlab-proxy-session")
122
122
  )
123
- return loop.run_until_complete(aiohttp_client(app))
123
+ return event_loop.run_until_complete(aiohttp_client(app))
124
124
 
125
125
 
126
126
  async def test_set_value_with_token(
@@ -256,7 +256,7 @@ async def test_get_value_with_token_in_query_params(
256
256
 
257
257
 
258
258
  @pytest.fixture
259
- def fake_server_without_auth_enabled(loop, aiohttp_client, monkeypatch):
259
+ def fake_server_without_auth_enabled(event_loop, aiohttp_client, monkeypatch):
260
260
  auth_enablement = "False"
261
261
  monkeypatch.setenv(
262
262
  mwi_env.get_env_name_enable_mwi_auth_token(), str(auth_enablement)
@@ -281,7 +281,7 @@ def fake_server_without_auth_enabled(loop, aiohttp_client, monkeypatch):
281
281
  aiohttp_session_setup(
282
282
  app, EncryptedCookieStorage(f, cookie_name="matlab-proxy-session")
283
283
  )
284
- return loop.run_until_complete(aiohttp_client(app))
284
+ return event_loop.run_until_complete(aiohttp_client(app))
285
285
 
286
286
 
287
287
  async def test_get_value(fake_server_without_auth_enabled):
@@ -1,4 +1,4 @@
1
- # Copyright 2020-2023 The MathWorks, Inc.
1
+ # Copyright 2020-2025 The MathWorks, Inc.
2
2
 
3
3
  import datetime
4
4
  import random
@@ -519,7 +519,7 @@ def test_range_matlab_connector_ports():
519
519
  not system.is_linux(),
520
520
  reason="Xvfb is only required on linux based operating systems",
521
521
  )
522
- async def test_create_xvfb_process(loop):
522
+ async def test_create_xvfb_process(event_loop):
523
523
  """Test to check if more than 1 xvfb process can be created with -displayfd flag
524
524
 
525
525
  Creates 2 xvfb processes with '-displayfd' flag and checks if the processes are
@@ -1,4 +1,4 @@
1
- # Copyright 2020-2024 The MathWorks, Inc.
1
+ # Copyright 2020-2025 The MathWorks, Inc.
2
2
 
3
3
  import asyncio
4
4
  import pytest
@@ -19,19 +19,19 @@ def test_get_supported_termination_signals():
19
19
  assert len(system.get_supported_termination_signals()) >= 1
20
20
 
21
21
 
22
- def test_add_signal_handlers(loop: asyncio.AbstractEventLoop):
23
- """Test to check if signal handlers are being added to asyncio loop
22
+ def test_add_signal_handlers(event_loop: asyncio.AbstractEventLoop):
23
+ """Test to check if signal handlers are being added to asyncio event_loop
24
24
 
25
25
  Args:
26
- loop (asyncio loop): In built-in pytest fixture.
26
+ event_loop (asyncio event loop): built-in pytest fixture.
27
27
  """
28
28
 
29
- loop = add_signal_handlers(loop)
29
+ event_loop = add_signal_handlers(event_loop)
30
30
 
31
31
  # In posix systems, event loop is modified with new signal handlers
32
32
  if system.is_posix():
33
- assert loop._signal_handlers is not None
34
- assert loop._signal_handlers.items() is not None
33
+ assert event_loop._signal_handlers is not None
34
+ assert event_loop._signal_handlers.items() is not None
35
35
 
36
36
  else:
37
37
  import signal