1
- # -*- coding: utf-8 -*-
2
1
import os
3
2
import re
4
3
import textwrap
@@ -604,7 +603,7 @@ def test_validates_conda_file(tmpdir):
604
603
)
605
604
build .validate ()
606
605
assert isinstance (build .conda , Conda )
607
- assert build .conda .environment == str ( tmpdir . join ( 'environment.yml' ))
606
+ assert build .conda .environment == 'environment.yml'
608
607
609
608
610
609
def test_file_is_required_when_using_conda (tmpdir ):
@@ -640,7 +639,7 @@ def test_requirements_file_repects_default_value(tmpdir):
640
639
build .validate ()
641
640
install = build .python .install
642
641
assert len (install ) == 1
643
- assert install [0 ].requirements == str ( tmpdir . join ( 'myrequirements.txt' ))
642
+ assert install [0 ].requirements == 'myrequirements.txt'
644
643
645
644
646
645
def test_requirements_file_respects_configuration (tmpdir ):
@@ -652,7 +651,7 @@ def test_requirements_file_respects_configuration(tmpdir):
652
651
build .validate ()
653
652
install = build .python .install
654
653
assert len (install ) == 1
655
- assert install [0 ].requirements == str ( tmpdir . join ( 'requirements.txt' ))
654
+ assert install [0 ].requirements == 'requirements.txt'
656
655
657
656
658
657
def test_requirements_file_is_null (tmpdir ):
@@ -744,7 +743,7 @@ def test_as_dict(tmpdir):
744
743
'python' : {
745
744
'version' : 3.7 ,
746
745
'install' : [{
747
- 'requirements' : str ( tmpdir . join ( 'requirements.txt' )) ,
746
+ 'requirements' : 'requirements.txt' ,
748
747
}],
749
748
'use_system_site_packages' : False ,
750
749
},
@@ -859,7 +858,7 @@ def test_conda_check_valid(self, tmpdir):
859
858
source_file = str (tmpdir .join ('readthedocs.yml' )),
860
859
)
861
860
build .validate ()
862
- assert build .conda .environment == str ( tmpdir . join ( 'environment.yml' ))
861
+ assert build .conda .environment == 'environment.yml'
863
862
864
863
def test_conda_check_invalid (self , tmpdir ):
865
864
apply_fs (tmpdir , {'environment.yml' : '' })
@@ -1054,7 +1053,7 @@ def test_python_install_check_default(self, tmpdir):
1054
1053
install = build .python .install
1055
1054
assert len (install ) == 1
1056
1055
assert isinstance (install [0 ], PythonInstall )
1057
- assert install [0 ].path == str ( tmpdir )
1056
+ assert install [0 ].path == '.'
1058
1057
assert install [0 ].method == PIP
1059
1058
assert install [0 ].extra_requirements == []
1060
1059
@@ -1107,7 +1106,7 @@ def test_python_install_requirements_check_valid(self, tmpdir):
1107
1106
install = build .python .install
1108
1107
assert len (install ) == 1
1109
1108
assert isinstance (install [0 ], PythonInstallRequirements )
1110
- assert install [0 ].requirements == str ( tmpdir . join ( 'requirements.txt' ))
1109
+ assert install [0 ].requirements == 'requirements.txt'
1111
1110
1112
1111
def test_python_install_requirements_check_invalid (self , tmpdir ):
1113
1112
apply_fs (tmpdir , {'requirements.txt' : '' })
@@ -1187,7 +1186,7 @@ def test_python_install_requirements_priority_over_default(self, tmpdir):
1187
1186
build .validate ()
1188
1187
install = build .python .install
1189
1188
assert len (install ) == 1
1190
- assert install [0 ].requirements == str ( tmpdir . join ( 'requirements.txt' ))
1189
+ assert install [0 ].requirements == 'requirements.txt'
1191
1190
1192
1191
@pytest .mark .parametrize ('value' , [3 , [], {}])
1193
1192
def test_python_install_requirements_check_invalid_types (self , value , tmpdir ):
@@ -1237,7 +1236,7 @@ def test_python_install_pip_check_valid(self, tmpdir):
1237
1236
build .validate ()
1238
1237
install = build .python .install
1239
1238
assert len (install ) == 1
1240
- assert install [0 ].path == str ( tmpdir )
1239
+ assert install [0 ].path == '.'
1241
1240
assert install [0 ].method == PIP
1242
1241
1243
1242
def test_python_install_pip_have_priority_over_default (self , tmpdir ):
@@ -1256,7 +1255,7 @@ def test_python_install_pip_have_priority_over_default(self, tmpdir):
1256
1255
build .validate ()
1257
1256
install = build .python .install
1258
1257
assert len (install ) == 1
1259
- assert install [0 ].path == str ( tmpdir )
1258
+ assert install [0 ].path == '.'
1260
1259
assert install [0 ].method == PIP
1261
1260
1262
1261
def test_python_install_setuptools_check_valid (self , tmpdir ):
@@ -1274,7 +1273,7 @@ def test_python_install_setuptools_check_valid(self, tmpdir):
1274
1273
build .validate ()
1275
1274
install = build .python .install
1276
1275
assert len (install ) == 1
1277
- assert install [0 ].path == str ( tmpdir )
1276
+ assert install [0 ].path == '.'
1278
1277
assert install [0 ].method == SETUPTOOLS
1279
1278
1280
1279
def test_python_install_setuptools_ignores_default (self ):
@@ -1301,7 +1300,7 @@ def test_python_install_setuptools_priority_over_default(self, tmpdir):
1301
1300
build .validate ()
1302
1301
install = build .python .install
1303
1302
assert len (install ) == 1
1304
- assert install [0 ].path == str ( tmpdir )
1303
+ assert install [0 ].path == '.'
1305
1304
assert install [0 ].method == SETUPTOOLS
1306
1305
1307
1306
def test_python_install_allow_empty_list (self ):
@@ -1419,14 +1418,14 @@ def test_python_install_several_respects_order(self, tmpdir):
1419
1418
install = build .python .install
1420
1419
assert len (install ) == 3
1421
1420
1422
- assert install [0 ].path == str ( tmpdir . join ( 'one' ))
1421
+ assert install [0 ].path == 'one'
1423
1422
assert install [0 ].method == PIP
1424
1423
assert install [0 ].extra_requirements == []
1425
1424
1426
- assert install [1 ].path == str ( tmpdir . join ( 'two' ))
1425
+ assert install [1 ].path == 'two'
1427
1426
assert install [1 ].method == SETUPTOOLS
1428
1427
1429
- assert install [2 ].requirements == str ( tmpdir . join ( 'three.txt' ))
1428
+ assert install [2 ].requirements == 'three.txt'
1430
1429
1431
1430
def test_python_install_reports_correct_invalid_index (self , tmpdir ):
1432
1431
apply_fs (tmpdir , {
@@ -1564,7 +1563,7 @@ def test_sphinx_configuration_check_valid(self, tmpdir):
1564
1563
source_file = str (tmpdir .join ('readthedocs.yml' )),
1565
1564
)
1566
1565
build .validate ()
1567
- assert build .sphinx .configuration == str ( tmpdir . join ( 'conf.py' ))
1566
+ assert build .sphinx .configuration == 'conf.py'
1568
1567
1569
1568
def test_sphinx_configuration_check_invalid (self , tmpdir ):
1570
1569
apply_fs (tmpdir , {'conf.py' : '' })
@@ -1607,7 +1606,7 @@ def test_sphinx_configuration_respects_default(self, tmpdir):
1607
1606
source_file = str (tmpdir .join ('readthedocs.yml' )),
1608
1607
)
1609
1608
build .validate ()
1610
- assert build .sphinx .configuration == str ( tmpdir . join ( 'conf.py' ))
1609
+ assert build .sphinx .configuration == 'conf.py'
1611
1610
1612
1611
def test_sphinx_configuration_default_can_be_none (self , tmpdir ):
1613
1612
apply_fs (tmpdir , {'conf.py' : '' })
@@ -1627,7 +1626,7 @@ def test_sphinx_configuration_priorities_over_default(self, tmpdir):
1627
1626
source_file = str (tmpdir .join ('readthedocs.yml' )),
1628
1627
)
1629
1628
build .validate ()
1630
- assert build .sphinx .configuration == str ( tmpdir . join ( 'conf.py' ))
1629
+ assert build .sphinx .configuration == 'conf.py'
1631
1630
1632
1631
@pytest .mark .parametrize ('value' , [[], True , 0 , {}])
1633
1632
def test_sphinx_configuration_validate_type (self , value ):
@@ -1674,7 +1673,7 @@ def test_mkdocs_configuration_check_valid(self, tmpdir):
1674
1673
source_file = str (tmpdir .join ('readthedocs.yml' )),
1675
1674
)
1676
1675
build .validate ()
1677
- assert build .mkdocs .configuration == str ( tmpdir . join ( 'mkdocs.yml' ))
1676
+ assert build .mkdocs .configuration == 'mkdocs.yml'
1678
1677
assert build .doctype == 'mkdocs'
1679
1678
assert build .sphinx is None
1680
1679
@@ -2032,7 +2031,7 @@ def test_as_dict(self, tmpdir):
2032
2031
'python' : {
2033
2032
'version' : 3.6 ,
2034
2033
'install' : [{
2035
- 'requirements' : str ( tmpdir . join ( 'requirements.txt' )) ,
2034
+ 'requirements' : 'requirements.txt' ,
2036
2035
}],
2037
2036
'use_system_site_packages' : False ,
2038
2037
},
0 commit comments