1414# along with this program. If not, see <http://www.gnu.org/licenses/>.
1515"""Test code and fixtures."""
1616
17- from getpass import getuser
1817import inspect
1918import logging
2019from pathlib import Path
2120from shutil import rmtree
22- from socket import gethostname
2321from tempfile import TemporaryDirectory
2422from uuid import uuid4
2523
2624import pytest
27- from tornado .web import HTTPError
2825from traitlets .config import Config
2926import zmq
3027
4744from cylc .flow .parsec .config import ParsecConfig
4845from cylc .flow .parsec .validate import cylc_config_validate
4946
47+
5048class AsyncClientFixture (WorkflowRuntimeClient ):
5149 pattern = zmq .REQ
5250 host = ''
@@ -223,7 +221,7 @@ def mock_authentication_yossarian(monkeypatch):
223221def jp_server_config (jp_template_dir ):
224222 """Config to turn the CylcUIServer extension on.
225223
226- Auto-loading, add as an argument in the test function to activate .
224+ Overrides jupyter server fixture of the same name .
227225 """
228226 config = {
229227 "ServerApp" : {
@@ -235,12 +233,9 @@ def jp_server_config(jp_template_dir):
235233 return config
236234
237235
238- @pytest .fixture
239- def patch_conf_files (monkeypatch ):
240- """Auto-patches the CylcUIServer to prevent it loading config files.
241-
242- Auto-loading, add as an argument in the test function to activate.
243- """
236+ @pytest .fixture (autouse = True )
237+ def patch_conf_files (monkeypatch : pytest .MonkeyPatch ):
238+ """Auto-patches the CylcUIServer to prevent it loading config files."""
244239 monkeypatch .setattr (
245240 'cylc.uiserver.app.CylcUIServer.config_file_paths' , []
246241 )
@@ -364,6 +359,7 @@ def workflow_run_dir(request):
364359 if not request .session .testsfailed :
365360 rmtree (run_dir )
366361
362+
367363@pytest .fixture
368364def mock_glbl_cfg (tmp_path : Path , monkeypatch : pytest .MonkeyPatch ):
369365 """A Pytest fixture for fiddling global config values.
0 commit comments