diff options
| author | jeffrey k eliasen <jeff@jke.net> | 2018-05-15 15:06:47 -0400 |
|---|---|---|
| committer | jeffrey k eliasen <jeff@jke.net> | 2018-05-15 15:06:47 -0400 |
| commit | 58ad1e140703a9214b63e120113a17d48142dc8a (patch) | |
| tree | 323c3bef20e84febab18d7af8b9025e14d43aeb2 /pkg_resources/tests/test_resources.py | |
| parent | 1a90187c407eacbd6bdad05d8bd6e1d94587faa8 (diff) | |
| download | python-setuptools-git-58ad1e140703a9214b63e120113a17d48142dc8a.tar.gz | |
python 2.7 does not implement object.__dir__()
Diffstat (limited to 'pkg_resources/tests/test_resources.py')
| -rw-r--r-- | pkg_resources/tests/test_resources.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg_resources/tests/test_resources.py b/pkg_resources/tests/test_resources.py index 3b14d7c0..04d02c1f 100644 --- a/pkg_resources/tests/test_resources.py +++ b/pkg_resources/tests/test_resources.py @@ -145,6 +145,16 @@ class TestDistro: for v in "Twisted>=1.5", "Twisted>=1.5\nZConfig>=2.0": self.checkRequires(self.distRequires(v), v) + needs_object_dir = pytest.mark.skipif( + not hasattr(object, '__dir__'), + reason='object.__dir__ necessary for self.__dir__ implementation', + ) + + def test_distribution_dir(self): + d = pkg_resources.Distribution() + dir(d) + + @needs_object_dir def test_distribution_dir_includes_provider_dir(self): d = pkg_resources.Distribution() before = d.__dir__() @@ -154,6 +164,7 @@ class TestDistro: assert len(after) == len(before) + 1 assert 'test_attr' in after + @needs_object_dir def test_distribution_dir_ignores_provider_dir_leading_underscore(self): d = pkg_resources.Distribution() before = d.__dir__() |
