File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -548,7 +548,7 @@ def locate_file(self, path):
548
548
"""
549
549
550
550
@classmethod
551
- def from_name (cls , name ):
551
+ def from_name (cls , name : str ):
552
552
"""Return the Distribution for the given package name.
553
553
554
554
:param name: The name of the distribution package to search for.
@@ -557,6 +557,8 @@ def from_name(cls, name):
557
557
:raises PackageNotFoundError: When the named package's distribution
558
558
metadata cannot be found.
559
559
"""
560
+ if not name :
561
+ raise ValueError ("A distribution name is required." )
560
562
for resolver in cls ._discover_resolvers ():
561
563
dists = resolver (DistributionFinder .Context (name = name ))
562
564
dist = next (iter (dists ), None )
Original file line number Diff line number Diff line change 1
1
import re
2
2
import json
3
3
import pickle
4
- import pytest
5
4
import unittest
6
5
import warnings
7
6
import importlib
@@ -51,7 +50,6 @@ def test_new_style_classes(self):
51
50
self .assertIsInstance (Distribution , type )
52
51
self .assertIsInstance (MetadataPathFinder , type )
53
52
54
- @pytest .mark .xfail (reason = "Not implemented" )
55
53
@fixtures .parameterize (
56
54
dict (name = None ),
57
55
dict (name = '' ),
You can’t perform that action at this time.
0 commit comments