@@ -46,7 +46,7 @@ def test_load_from_file(self, temp_dir):
4646 Allows users to specify a config other than the default `properdocs.yml`.
4747 """
4848 with open (os .path .join (temp_dir , 'properdocs.yml' ), 'w' ) as config_file :
49- config_file .write ("site_name: ProperDocs Test\n " )
49+ config_file .write ("site_name: ProperDocs Test\n theme: mkdocs \ n " )
5050 os .mkdir (os .path .join (temp_dir , 'docs' ))
5151
5252 cfg = base .load_config (config_file = config_file .name )
@@ -57,7 +57,7 @@ def test_load_from_file(self, temp_dir):
5757 def test_load_default_file (self , temp_dir ):
5858 """Test that `properdocs.yml` will be loaded when '--config' is not set."""
5959 with open (os .path .join (temp_dir , 'properdocs.yml' ), 'w' ) as config_file :
60- config_file .write ("site_name: ProperDocs Test\n " )
60+ config_file .write ("site_name: ProperDocs Test\n theme: mkdocs \ n " )
6161 os .mkdir (os .path .join (temp_dir , 'docs' ))
6262 with change_dir (temp_dir ):
6363 cfg = base .load_config (config_file = None )
@@ -68,7 +68,7 @@ def test_load_default_file(self, temp_dir):
6868 def test_load_default_file_with_yaml (self , temp_dir ):
6969 """Test that `properdocs.yml` will be loaded when '--config' is not set."""
7070 with open (os .path .join (temp_dir , 'properdocs.yaml' ), 'w' ) as config_file :
71- config_file .write ("site_name: ProperDocs Test\n " )
71+ config_file .write ("site_name: ProperDocs Test\n theme: mkdocs \ n " )
7272 os .mkdir (os .path .join (temp_dir , 'docs' ))
7373 with change_dir (temp_dir ):
7474 cfg = base .load_config (config_file = None )
@@ -79,9 +79,9 @@ def test_load_default_file_with_yaml(self, temp_dir):
7979 def test_load_default_file_prefer_yml (self , temp_dir ):
8080 """Test that `properdocs.yml` will be loaded when '--config' is not set."""
8181 with open (os .path .join (temp_dir , 'properdocs.yml' ), 'w' ) as config_file1 :
82- config_file1 .write ("site_name: ProperDocs Test1\n " )
82+ config_file1 .write ("site_name: ProperDocs Test1\n theme: mkdocs \ n " )
8383 with open (os .path .join (temp_dir , 'properdocs.yaml' ), 'w' ) as config_file2 :
84- config_file2 .write ("site_name: ProperDocs Test2\n " )
84+ config_file2 .write ("site_name: ProperDocs Test2\n theme: mkdocs \ n " )
8585
8686 os .mkdir (os .path .join (temp_dir , 'docs' ))
8787 with change_dir (temp_dir ):
@@ -104,7 +104,15 @@ def test_load_from_open_file(self, temp_path):
104104 config_file .flush ()
105105 os .mkdir (os .path .join (temp_path , 'docs' ))
106106
107- cfg = base .load_config (config_file = config_file )
107+ with self .assertLogs ('properdocs' ) as cm :
108+ cfg = base .load_config (config_file = config_file )
109+ self .assertEqual (
110+ cm .output ,
111+ [
112+ "WARNING:properdocs.config.config_options:Please select a theme explicitly in 'properdocs.yml'. Defaulted to 'theme: mkdocs', but this may change in the future."
113+ ],
114+ )
115+
108116 self .assertTrue (isinstance (cfg , defaults .ProperDocsConfig ))
109117 self .assertEqual (cfg .site_name , 'ProperDocs Test' )
110118 # load_config will always close the file
@@ -117,7 +125,7 @@ def test_load_from_closed_file(self, temp_dir):
117125 Ensure `load_config` reloads the closed file.
118126 """
119127 with open (os .path .join (temp_dir , 'properdocs.yml' ), 'w' ) as config_file :
120- config_file .write ("site_name: ProperDocs Test\n " )
128+ config_file .write ("site_name: ProperDocs Test\n theme: mkdocs \ n " )
121129 os .mkdir (os .path .join (temp_dir , 'docs' ))
122130
123131 cfg = base .load_config (config_file = config_file )
@@ -248,7 +256,7 @@ def test_load_from_file_with_relative_paths(self, config_dir):
248256 """
249257 config_fname = os .path .join (config_dir , 'properdocs.yml' )
250258 with open (config_fname , 'w' ) as config_file :
251- config_file .write ("docs_dir: src\n site_name: ProperDocs Test\n " )
259+ config_file .write ("docs_dir: src\n site_name: ProperDocs Test\n theme: mkdocs \ n " )
252260 docs_dir = os .path .join (config_dir , 'src' )
253261 os .mkdir (docs_dir )
254262
0 commit comments