delete useless tests

This commit is contained in:
Frost Ming
2021-08-05 14:38:04 +08:00
parent 750cf98d28
commit 9dbf157f8b
3 changed files with 6 additions and 140 deletions
+6 -5
View File
@@ -646,11 +646,12 @@ class Resolver:
req.requirement.marker and not req.requirement.marker.evaluate()
):
pypi = resolver.finder if resolver else None
name, specifier = req.ireq.name, req.ireq.specifier
best_match = pypi.find_best_candidate(name, specifier).best_candidate if pypi else None
ireq = req.ireq
best_match = pypi.find_best_candidate(ireq.name, ireq.specifier).best_candidate if pypi else None
if best_match:
hashes = resolver.collect_hashes(best_match) if resolver else []
new_req = Requirement.from_ireq(best_match)
ireq.req.specifier = ireq.specifier.__class__(f"=={best_match.version}")
hashes = resolver.collect_hashes(ireq) if resolver else []
new_req = Requirement.from_ireq(ireq)
new_req = new_req.add_hashes(hashes)
name, entry = new_req.pipfile_entry
locked_deps[pep423_name(name)] = translate_markers(entry)
@@ -980,7 +981,7 @@ class Resolver:
if link.hash and link.hash_name == shims.FAVORITE_HASH:
return f"{link.hash_name}:{link.hash}"
return self.hash_cache.get(link)
return self.hash_cache.get_hash(link)
def _clean_skipped_result(self, req, value):
ref = None
@@ -127,8 +127,6 @@ funcsigs = "*"
@flaky
@pytest.mark.markers
@pytest.mark.complex
@pytest.mark.py3_only
@pytest.mark.skip("test is flaky on CI")
def test_resolver_unique_markers(PipenvInstance):
"""vcrpy has a dependency on `yarl` which comes with a marker
of 'python version in "3.4, 3.5, 3.6" - this marker duplicates itself:
@@ -140,8 +138,6 @@ def test_resolver_unique_markers(PipenvInstance):
with PipenvInstance(chdir=True) as p:
c = p.pipenv('install vcrpy==2.0.1')
assert c.returncode == 0
c = p.pipenv('lock')
assert c.returncode == 0
assert 'yarl' in p.lockfile['default']
yarl = p.lockfile['default']['yarl']
assert 'markers' in yarl
-131
View File
@@ -1,131 +0,0 @@
import pytest
from notpip._internal.index.package_finder import PackageFinder
get_extras_links_scenarios = {
'windows and not windows': (
[
'chardet',
'[:platform_system != "windows"]',
'twisted',
'[:platform_system == "windows"]',
'twisted[windows_platform]',
],
{
':platform_system != "windows"': [
'twisted',
],
':platform_system == "windows"': [
'twisted[windows_platform]',
],
},
),
'requests': (
[
'chardet<3.1.0,>=3.0.2',
'idna<2.7,>=2.5',
'urllib3<1.23,>=1.21.1',
'certifi>=2017.4.17',
'[security]',
'pyOpenSSL>=0.14',
'cryptography>=1.3.4',
'idna>=2.0.0',
'[socks]',
'PySocks!=1.5.7,>=1.5.6',
(
'[socks:sys_platform == "win32"'
' and (python_version == "2.7" or python_version == "2.6")]'
),
'win_inet_pton',
],
{
'security': [
'pyOpenSSL>=0.14',
'cryptography>=1.3.4',
'idna>=2.0.0',
],
'socks': [
'PySocks!=1.5.7,>=1.5.6',
],
'socks:sys_platform == "win32" '
'and (python_version == "2.7" or python_version == "2.6")': [
'win_inet_pton',
],
}
),
'attrs': (
[
'[dev]',
'coverage',
'hypothesis',
'pympler',
'pytest',
'six',
'zope.interface',
'sphinx',
'zope.interface',
'[docs]',
'sphinx',
'zope.interface',
'[tests]',
'coverage',
'hypothesis',
'pympler',
'pytest',
'six',
'zope.interface',
],
{
'dev': [
'coverage',
'hypothesis',
'pympler',
'pytest',
'six',
'zope.interface',
'sphinx',
'zope.interface',
],
'docs': [
'sphinx',
'zope.interface',
],
'tests': [
'coverage',
'hypothesis',
'pympler',
'pytest',
'six',
'zope.interface',
],
},
),
'misc': (
[
'chardet',
'[:platform_system != "windows"]',
'attrs',
'[:platform_system == "windows"]',
'pytz',
],
{
':platform_system != "windows"': [
'attrs',
],
':platform_system == "windows"': [
'pytz',
],
},
),
}
@pytest.mark.patched
@pytest.mark.parametrize(
'scenarios,expected',
list(get_extras_links_scenarios.values()),
ids=list(get_extras_links_scenarios.keys()),
)
def test_get_extras_links(scenarios, expected):
assert PackageFinder.get_extras_links(scenarios) == expected