1
- # -*- coding: utf-8 -*-
2
1
import os
3
2
import re
4
3
import textwrap
@@ -571,7 +570,7 @@ def test_validates_conda_file(tmpdir):
571
570
)
572
571
build .validate ()
573
572
assert isinstance (build .conda , Conda )
574
- assert build .conda .environment == str ( tmpdir . join ( 'environment.yml' ))
573
+ assert build .conda .environment == 'environment.yml'
575
574
576
575
577
576
def test_file_is_required_when_using_conda (tmpdir ):
@@ -607,7 +606,7 @@ def test_requirements_file_repects_default_value(tmpdir):
607
606
build .validate ()
608
607
install = build .python .install
609
608
assert len (install ) == 1
610
- assert install [0 ].requirements == str ( tmpdir . join ( 'myrequirements.txt' ))
609
+ assert install [0 ].requirements == 'myrequirements.txt'
611
610
612
611
613
612
def test_requirements_file_respects_configuration (tmpdir ):
@@ -619,7 +618,7 @@ def test_requirements_file_respects_configuration(tmpdir):
619
618
build .validate ()
620
619
install = build .python .install
621
620
assert len (install ) == 1
622
- assert install [0 ].requirements == str ( tmpdir . join ( 'requirements.txt' ))
621
+ assert install [0 ].requirements == 'requirements.txt'
623
622
624
623
625
624
def test_requirements_file_is_null (tmpdir ):
@@ -711,7 +710,7 @@ def test_as_dict(tmpdir):
711
710
'python' : {
712
711
'version' : 3.5 ,
713
712
'install' : [{
714
- 'requirements' : str ( tmpdir . join ( 'requirements.txt' )) ,
713
+ 'requirements' : 'requirements.txt' ,
715
714
}],
716
715
'use_system_site_packages' : False ,
717
716
},
@@ -826,7 +825,7 @@ def test_conda_check_valid(self, tmpdir):
826
825
source_file = str (tmpdir .join ('readthedocs.yml' )),
827
826
)
828
827
build .validate ()
829
- assert build .conda .environment == str ( tmpdir . join ( 'environment.yml' ))
828
+ assert build .conda .environment == 'environment.yml'
830
829
831
830
def test_conda_check_invalid (self , tmpdir ):
832
831
apply_fs (tmpdir , {'environment.yml' : '' })
@@ -1021,7 +1020,7 @@ def test_python_install_check_default(self, tmpdir):
1021
1020
install = build .python .install
1022
1021
assert len (install ) == 1
1023
1022
assert isinstance (install [0 ], PythonInstall )
1024
- assert install [0 ].path == str ( tmpdir )
1023
+ assert install [0 ].path == '.'
1025
1024
assert install [0 ].method == PIP
1026
1025
assert install [0 ].extra_requirements == []
1027
1026
@@ -1074,7 +1073,7 @@ def test_python_install_requirements_check_valid(self, tmpdir):
1074
1073
install = build .python .install
1075
1074
assert len (install ) == 1
1076
1075
assert isinstance (install [0 ], PythonInstallRequirements )
1077
- assert install [0 ].requirements == str ( tmpdir . join ( 'requirements.txt' ))
1076
+ assert install [0 ].requirements == 'requirements.txt'
1078
1077
1079
1078
def test_python_install_requirements_check_invalid (self , tmpdir ):
1080
1079
apply_fs (tmpdir , {'requirements.txt' : '' })
@@ -1154,7 +1153,7 @@ def test_python_install_requirements_priority_over_default(self, tmpdir):
1154
1153
build .validate ()
1155
1154
install = build .python .install
1156
1155
assert len (install ) == 1
1157
- assert install [0 ].requirements == str ( tmpdir . join ( 'requirements.txt' ))
1156
+ assert install [0 ].requirements == 'requirements.txt'
1158
1157
1159
1158
@pytest .mark .parametrize ('value' , [3 , [], {}])
1160
1159
def test_python_install_requirements_check_invalid_types (self , value , tmpdir ):
@@ -1204,7 +1203,7 @@ def test_python_install_pip_check_valid(self, tmpdir):
1204
1203
build .validate ()
1205
1204
install = build .python .install
1206
1205
assert len (install ) == 1
1207
- assert install [0 ].path == str ( tmpdir )
1206
+ assert install [0 ].path == '.'
1208
1207
assert install [0 ].method == PIP
1209
1208
1210
1209
def test_python_install_pip_have_priority_over_default (self , tmpdir ):
@@ -1223,7 +1222,7 @@ def test_python_install_pip_have_priority_over_default(self, tmpdir):
1223
1222
build .validate ()
1224
1223
install = build .python .install
1225
1224
assert len (install ) == 1
1226
- assert install [0 ].path == str ( tmpdir )
1225
+ assert install [0 ].path == '.'
1227
1226
assert install [0 ].method == PIP
1228
1227
1229
1228
def test_python_install_setuptools_check_valid (self , tmpdir ):
@@ -1241,7 +1240,7 @@ def test_python_install_setuptools_check_valid(self, tmpdir):
1241
1240
build .validate ()
1242
1241
install = build .python .install
1243
1242
assert len (install ) == 1
1244
- assert install [0 ].path == str ( tmpdir )
1243
+ assert install [0 ].path == '.'
1245
1244
assert install [0 ].method == SETUPTOOLS
1246
1245
1247
1246
def test_python_install_setuptools_ignores_default (self ):
@@ -1268,7 +1267,7 @@ def test_python_install_setuptools_priority_over_default(self, tmpdir):
1268
1267
build .validate ()
1269
1268
install = build .python .install
1270
1269
assert len (install ) == 1
1271
- assert install [0 ].path == str ( tmpdir )
1270
+ assert install [0 ].path == '.'
1272
1271
assert install [0 ].method == SETUPTOOLS
1273
1272
1274
1273
def test_python_install_allow_empty_list (self ):
@@ -1386,14 +1385,14 @@ def test_python_install_several_respects_order(self, tmpdir):
1386
1385
install = build .python .install
1387
1386
assert len (install ) == 3
1388
1387
1389
- assert install [0 ].path == str ( tmpdir . join ( 'one' ))
1388
+ assert install [0 ].path == 'one'
1390
1389
assert install [0 ].method == PIP
1391
1390
assert install [0 ].extra_requirements == []
1392
1391
1393
- assert install [1 ].path == str ( tmpdir . join ( 'two' ))
1392
+ assert install [1 ].path == 'two'
1394
1393
assert install [1 ].method == SETUPTOOLS
1395
1394
1396
- assert install [2 ].requirements == str ( tmpdir . join ( 'three.txt' ))
1395
+ assert install [2 ].requirements == 'three.txt'
1397
1396
1398
1397
def test_python_install_reports_correct_invalid_index (self , tmpdir ):
1399
1398
apply_fs (tmpdir , {
@@ -1531,7 +1530,7 @@ def test_sphinx_configuration_check_valid(self, tmpdir):
1531
1530
source_file = str (tmpdir .join ('readthedocs.yml' )),
1532
1531
)
1533
1532
build .validate ()
1534
- assert build .sphinx .configuration == str ( tmpdir . join ( 'conf.py' ))
1533
+ assert build .sphinx .configuration == 'conf.py'
1535
1534
1536
1535
def test_sphinx_configuration_check_invalid (self , tmpdir ):
1537
1536
apply_fs (tmpdir , {'conf.py' : '' })
@@ -1574,7 +1573,7 @@ def test_sphinx_configuration_respects_default(self, tmpdir):
1574
1573
source_file = str (tmpdir .join ('readthedocs.yml' )),
1575
1574
)
1576
1575
build .validate ()
1577
- assert build .sphinx .configuration == str ( tmpdir . join ( 'conf.py' ))
1576
+ assert build .sphinx .configuration == 'conf.py'
1578
1577
1579
1578
def test_sphinx_configuration_default_can_be_none (self , tmpdir ):
1580
1579
apply_fs (tmpdir , {'conf.py' : '' })
@@ -1594,7 +1593,7 @@ def test_sphinx_configuration_priorities_over_default(self, tmpdir):
1594
1593
source_file = str (tmpdir .join ('readthedocs.yml' )),
1595
1594
)
1596
1595
build .validate ()
1597
- assert build .sphinx .configuration == str ( tmpdir . join ( 'conf.py' ))
1596
+ assert build .sphinx .configuration == 'conf.py'
1598
1597
1599
1598
@pytest .mark .parametrize ('value' , [[], True , 0 , {}])
1600
1599
def test_sphinx_configuration_validate_type (self , value ):
@@ -1641,7 +1640,7 @@ def test_mkdocs_configuration_check_valid(self, tmpdir):
1641
1640
source_file = str (tmpdir .join ('readthedocs.yml' )),
1642
1641
)
1643
1642
build .validate ()
1644
- assert build .mkdocs .configuration == str ( tmpdir . join ( 'mkdocs.yml' ))
1643
+ assert build .mkdocs .configuration == 'mkdocs.yml'
1645
1644
assert build .doctype == 'mkdocs'
1646
1645
assert build .sphinx is None
1647
1646
@@ -1999,7 +1998,7 @@ def test_as_dict(self, tmpdir):
1999
1998
'python' : {
2000
1999
'version' : 3.6 ,
2001
2000
'install' : [{
2002
- 'requirements' : str ( tmpdir . join ( 'requirements.txt' )) ,
2001
+ 'requirements' : 'requirements.txt' ,
2003
2002
}],
2004
2003
'use_system_site_packages' : False ,
2005
2004
},
0 commit comments