1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Avoid importing TestFailure at the top level

This will make pytest-3.0 emit a warning:

cannot collect test class 'TestFailure' because it has a __init__ constructor
This commit is contained in:
Bruno Oliveira 2016-07-28 21:36:45 -03:00
parent da29750ebc
commit c73abf81db

View file

@ -4,13 +4,14 @@ import pytest
import glob
from tests.lib.path import Path
from tests.lib import TestFailure
def test_install_from_future_wheel_version(script, data):
"""
Test installing a future wheel
"""
from tests.lib import TestFailure
package = data.packages.join("futurewheel-3.0-py2.py3-none-any.whl")
result = script.pip('install', package, '--no-index', expect_error=True)
with pytest.raises(TestFailure):
@ -30,6 +31,7 @@ def test_install_from_broken_wheel(script, data):
"""
Test that installing a broken wheel fails properly
"""
from tests.lib import TestFailure
package = data.packages.join("brokenwheel-1.0-py2.py3-none-any.whl")
result = script.pip('install', package, '--no-index', expect_error=True)
with pytest.raises(TestFailure):