File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
clients/python/test/test_osparc Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 11import json
2- import os
32import subprocess
43from pathlib import Path
54from typing import Any , Dict , List , Set
6-
5+ from faker import Faker
76import osparc
87import osparc ._settings
98import pydantic
@@ -75,15 +74,17 @@ def test_dependencies(tmp_path: Path):
7574
7675
7776@pytest .mark .parametrize ("valid" , [True , False ])
78- def test_parent_project_validation (faker , valid : bool ):
77+ def test_parent_project_validation (
78+ faker : Faker , monkeypatch : pytest .MonkeyPatch , valid : bool
79+ ):
7980 if valid :
80- os . environ [ "OSPARC_STUDY_ID" ] = f" { faker .uuid4 ()} "
81- os . environ [ "OSPARC_NODE_ID" ] = f" { faker .uuid4 ()} "
81+ monkeypatch . setenv ( "OSPARC_STUDY_ID" , faker .uuid4 ())
82+ monkeypatch . setenv ( "OSPARC_NODE_ID" , faker .uuid4 ())
8283 parent_info = osparc ._settings .ParentProjectInfo ()
8384 assert parent_info .x_simcore_parent_project_uuid is not None
8485 assert parent_info .x_simcore_parent_node_id is not None
8586 else :
86- os . environ [ "OSPARC_STUDY_ID" ] = f" { faker .text ()} "
87- os . environ [ "OSPARC_NODE_ID" ] = f" { faker .text ()} "
87+ monkeypatch . setenv ( "OSPARC_STUDY_ID" , faker .text ())
88+ monkeypatch . setenv ( "OSPARC_NODE_ID" , faker .text ())
8889 with pytest .raises (pydantic .ValidationError ):
8990 _ = osparc ._settings .ParentProjectInfo ()
You can’t perform that action at this time.
0 commit comments