1818from isort .main import main
1919
2020
21- def git_clone (repository_url : str , directory : Path ):
21+ def git_clone (repository_url : str , directory : Path ) -> None :
2222 """Clones the given repository into the given directory path"""
2323 check_call (["git" , "clone" , "--depth" , "1" , repository_url , str (directory )])
2424
2525
26- def run_isort (arguments : Generator [str , None , None ] | Sequence [str ]):
26+ def run_isort (arguments : Generator [str , None , None ] | Sequence [str ]) -> None :
2727 """Runs isort in diff and check mode with the given arguments"""
2828 main (["--check-only" , "--diff" , * arguments ])
2929
3030
31- def test_django (tmpdir ) :
32- git_clone ("https://github.com/django/django.git" , tmpdir )
31+ def test_django (tmp_path : Path ) -> None :
32+ git_clone ("https://github.com/django/django.git" , tmp_path )
3333 run_isort (
34- str (target_dir ) for target_dir in (tmpdir / "django" , tmpdir / "tests" , tmpdir / "scripts" )
34+ str (target_dir )
35+ for target_dir in (tmp_path / "django" , tmp_path / "tests" , tmp_path / "scripts" )
3536 )
3637
3738
38- def test_plone (tmpdir ) :
39- git_clone ("https://github.com/plone/plone.app.multilingualindexes.git" , tmpdir )
40- run_isort ([str (tmpdir / "src" ), "--skip" , "languagefallback.py" ])
39+ def test_plone (tmp_path : Path ) -> None :
40+ git_clone ("https://github.com/plone/plone.app.multilingualindexes.git" , tmp_path )
41+ run_isort ([str (tmp_path / "src" ), "--skip" , "languagefallback.py" ])
4142
4243
4344@pytest .mark .skip (
4445 "Skip for now as #2295 introduce a breaking change. Can be re-enabled after pandas has updated."
4546)
46- def test_pandas (tmpdir ) :
47- git_clone ("https://github.com/pandas-dev/pandas.git" , tmpdir )
48- run_isort ((str (tmpdir / "pandas" ), "--skip" , "__init__.py" ))
47+ def test_pandas (tmp_path : Path ) -> None :
48+ git_clone ("https://github.com/pandas-dev/pandas.git" , tmp_path )
49+ run_isort ((str (tmp_path / "pandas" ), "--skip" , "__init__.py" ))
4950
5051
51- def test_habitat_lab (tmpdir ) :
52- git_clone ("https://github.com/facebookresearch/habitat-lab.git" , tmpdir )
53- run_isort ([str (tmpdir )])
52+ def test_habitat_lab (tmp_path : Path ) -> None :
53+ git_clone ("https://github.com/facebookresearch/habitat-lab.git" , tmp_path )
54+ run_isort ([str (tmp_path )])
5455
5556
56- def test_pylint (tmpdir ) :
57- git_clone ("https://github.com/PyCQA/pylint.git" , tmpdir )
58- run_isort ([str (tmpdir ), "--skip" , "bad.py" ])
57+ def test_pylint (tmp_path : Path ) -> None :
58+ git_clone ("https://github.com/PyCQA/pylint.git" , tmp_path )
59+ run_isort ([str (tmp_path ), "--skip" , "bad.py" ])
5960
6061
61- def test_hypothesis (tmpdir ) :
62- git_clone ("https://github.com/HypothesisWorks/hypothesis.git" , tmpdir )
62+ def test_hypothesis (tmp_path : Path ) -> None :
63+ git_clone ("https://github.com/HypothesisWorks/hypothesis.git" , tmp_path )
6364 run_isort (
6465 (
65- str (tmpdir ),
66+ str (tmp_path ),
6667 "--skip" ,
6768 "tests" ,
6869 "--profile" ,
@@ -76,24 +77,24 @@ def test_hypothesis(tmpdir):
7677 )
7778
7879
79- def test_pyramid (tmpdir ) :
80- git_clone ("https://github.com/Pylons/pyramid.git" , tmpdir )
80+ def test_pyramid (tmp_path : Path ) -> None :
81+ git_clone ("https://github.com/Pylons/pyramid.git" , tmp_path )
8182 run_isort (
8283 str (target_dir )
83- for target_dir in (tmpdir / "src" / "pyramid" , tmpdir / "tests" , tmpdir / "setup.py" )
84+ for target_dir in (tmp_path / "src" / "pyramid" , tmp_path / "tests" , tmp_path / "setup.py" )
8485 )
8586
8687
87- def test_products_zopetree (tmpdir ) :
88- git_clone ("https://github.com/jugmac00/Products.ZopeTree.git" , tmpdir )
89- run_isort ([str (tmpdir )])
88+ def test_products_zopetree (tmp_path : Path ) -> None :
89+ git_clone ("https://github.com/jugmac00/Products.ZopeTree.git" , tmp_path )
90+ run_isort ([str (tmp_path )])
9091
9192
92- def test_dobby (tmpdir ) :
93- git_clone ("https://github.com/rocketDuck/dobby.git" , tmpdir )
94- run_isort ([str (tmpdir / "tests" ), str (tmpdir / "src" )])
93+ def test_dobby (tmp_path : Path ) -> None :
94+ git_clone ("https://github.com/rocketDuck/dobby.git" , tmp_path )
95+ run_isort ([str (tmp_path / "tests" ), str (tmp_path / "src" )])
9596
9697
97- def test_zope (tmpdir ) :
98- git_clone ("https://github.com/zopefoundation/Zope.git" , tmpdir )
99- run_isort ([str (tmpdir ), "--skip" , "util.py" ])
98+ def test_zope (tmp_path : Path ) -> None :
99+ git_clone ("https://github.com/zopefoundation/Zope.git" , tmp_path )
100+ run_isort ([str (tmp_path ), "--skip" , "util.py" ])
0 commit comments