1
- import py
1
+ from pathlib import Path
2
+ import shutil
2
3
import pytest
3
4
import pkg_resources
4
5
5
6
6
- TESTS_DATA_DIR = py . path . local (__file__ ).dirpath ( 'data' )
7
+ TESTS_DATA_DIR = Path (__file__ ).parent / 'data'
7
8
8
9
9
10
class TestFindDistributions :
@@ -19,21 +20,21 @@ def test_non_egg_dir_named_egg(self, target_dir):
19
20
assert not list (dists )
20
21
21
22
def test_standalone_egg_directory (self , target_dir ):
22
- (TESTS_DATA_DIR / 'my-test-package_unpacked-egg' ). copy ( target_dir )
23
+ shutil . copy (TESTS_DATA_DIR / 'my-test-package_unpacked-egg' , target_dir )
23
24
dists = pkg_resources .find_distributions (str (target_dir ))
24
25
assert [dist .project_name for dist in dists ] == ['my-test-package' ]
25
26
dists = pkg_resources .find_distributions (str (target_dir ), only = True )
26
27
assert not list (dists )
27
28
28
29
def test_zipped_egg (self , target_dir ):
29
- (TESTS_DATA_DIR / 'my-test-package_zipped-egg' ). copy ( target_dir )
30
+ shutil . copy (TESTS_DATA_DIR / 'my-test-package_zipped-egg' , target_dir )
30
31
dists = pkg_resources .find_distributions (str (target_dir ))
31
32
assert [dist .project_name for dist in dists ] == ['my-test-package' ]
32
33
dists = pkg_resources .find_distributions (str (target_dir ), only = True )
33
34
assert not list (dists )
34
35
35
36
def test_zipped_sdist_one_level_removed (self , target_dir ):
36
- (TESTS_DATA_DIR / 'my-test-package-zip' ). copy ( target_dir )
37
+ shutil . copy (TESTS_DATA_DIR / 'my-test-package-zip' , target_dir )
37
38
dists = pkg_resources .find_distributions (
38
39
str (target_dir / "my-test-package.zip" )
39
40
)
0 commit comments