From a9f9a61ee3936f05f7018f6491f934de09950a9d Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Wed, 18 Sep 2024 15:23:43 +0530 Subject: [PATCH] Don't make `is_valid_json` a fixture --- pyodide_build/tests/test_cli_xbuildenv.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/pyodide_build/tests/test_cli_xbuildenv.py b/pyodide_build/tests/test_cli_xbuildenv.py index e623ff8..208aa8e 100644 --- a/pyodide_build/tests/test_cli_xbuildenv.py +++ b/pyodide_build/tests/test_cli_xbuildenv.py @@ -26,16 +26,12 @@ def mock_pyodide_lock() -> PyodideLockSpec: ) -@pytest.fixture() -def is_valid_json(): - def _is_valid_json(json_str): - try: - json.loads(json_str) - except json.JSONDecodeError: - return False - return True - - return _is_valid_json +def is_valid_json(json_str) -> bool: + try: + json.loads(json_str) + except json.JSONDecodeError: + return False + return True @pytest.fixture() @@ -358,9 +354,7 @@ def test_xbuildenv_search( assert [col.strip() for col in row1] == ["0.1.0", "4.5.6", "1.39.8", "-", "No"] -def test_xbuildenv_search_json( - tmp_path, fake_xbuildenv_releases_compatible, is_valid_json -): +def test_xbuildenv_search_json(tmp_path, fake_xbuildenv_releases_compatible): result = runner.invoke( xbuildenv.app, [