def test_list_prints_json(testdir):
    """Ensure output of list --json is JSON compatible"""
    result = run(
        ["-i", "tests.config.settings", "list", "--json"],
        env={"ROOT_PATH_FOR_DYNACONF": testdir},
    )
    data = json.loads(result)
    assert data["TEST_KEY"] == "test_value"
    assert data["A_PATH"] == "foo"
Ensure output of list --json is JSON compatible
tests/test_cli.py