1
1
"""Tests for placing config dicts into :py:class:`Project` objects."""
2
- from _pytest . compat import LEGACY_PATH
2
+ import pathlib
3
3
4
4
from libvcs import BaseSync , GitSync , HgSync , SvnSync
5
5
from libvcs ._internal .shortcuts import create_project
@@ -54,7 +54,7 @@ def test_to_dictlist():
54
54
assert "url" == remote
55
55
56
56
57
- def test_vcs_url_scheme_to_object (tmpdir : LEGACY_PATH ):
57
+ def test_vcs_url_scheme_to_object (tmp_path : pathlib . Path ):
58
58
"""Verify `url` return {Git,Mercurial,Subversion}Project.
59
59
60
60
:class:`GitSync`, :class:`HgSync` or :class:`SvnSync`
@@ -64,7 +64,7 @@ def test_vcs_url_scheme_to_object(tmpdir: LEGACY_PATH):
64
64
git_repo = create_project (
65
65
vcs = "git" ,
66
66
url = "git+git://git.myproject.org/MyProject.git@da39a3ee5e6b4b" ,
67
- dir = str (tmpdir . join ( "myproject1" ) ),
67
+ dir = str (tmp_path / "myproject1" ),
68
68
)
69
69
70
70
# TODO cwd and name if duplicated should give an error
@@ -75,7 +75,7 @@ def test_vcs_url_scheme_to_object(tmpdir: LEGACY_PATH):
75
75
hg_repo = create_project (
76
76
vcs = "hg" ,
77
77
url = "hg+https://hg.myproject.org/MyProject#egg=MyProject" ,
78
- dir = str (tmpdir . join ( "myproject2" ) ),
78
+ dir = str (tmp_path / "myproject2" ),
79
79
)
80
80
81
81
assert isinstance (hg_repo , HgSync )
@@ -84,14 +84,14 @@ def test_vcs_url_scheme_to_object(tmpdir: LEGACY_PATH):
84
84
svn_repo = create_project (
85
85
vcs = "svn" ,
86
86
url = "svn+svn://svn.myproject.org/svn/MyProject#egg=MyProject" ,
87
- dir = str (tmpdir . join ( "myproject3" ) ),
87
+ dir = str (tmp_path / "myproject3" ),
88
88
)
89
89
90
90
assert isinstance (svn_repo , SvnSync )
91
91
assert isinstance (svn_repo , BaseSync )
92
92
93
93
94
- def test_to_repo_objects (tmpdir : LEGACY_PATH ):
94
+ def test_to_repo_objects (tmp_path : pathlib . Path ):
95
95
""":py:obj:`dict` objects into Project objects."""
96
96
repo_list = filter_repos (fixtures .config_dict_expanded )
97
97
for repo_dict in repo_list :
0 commit comments