Add test for docs file
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from numpy.testing import assert_allclose
+from pathlib import Path
import yaml
from gammapy.scripts import Analysis
from gammapy.utils.testing import requires_data, requires_dependency
@@ -195,6 +196,13 @@ def test_validate_config():
assert analysis.config.validate() is None
+def test_docs_file():
+ path = Path(__file__).resolve().parent / ".." / "config"
+ filename = path / "docs.yaml"
+ analysis = Analysis.from_yaml(filename)
+ assert analysis.config.validate() is None
+
+
def test_help():
analysis = Analysis.from_template(template="basic")
assert analysis.config.help() is None
