Skip to content

Commit

Permalink
Don't make is_valid_json a fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
agriyakhetarpal committed Sep 18, 2024
1 parent 5370c25 commit a9f9a61
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions pyodide_build/tests/test_cli_xbuildenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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,
[
Expand Down

0 comments on commit a9f9a61

Please sign in to comment.