Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions tools/wheel_resolver/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ python_test(
"__init___test.py",
"wheel_test.py",
],
test_runner="pytest",
deps=[
":wheel",
"//third_party/python:pytest",
],
)
3 changes: 2 additions & 1 deletion tools/wheel_resolver/__init___test.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import click.testing
import unittest
import unittest.mock
import tools.wheel_resolver as sut


class TestMain:
class TestMain(unittest.TestCase):
def test_help(self) -> None:
runner = click.testing.CliRunner()
result = runner.invoke(cli=sut.main, args=["--help"])
Expand Down
12 changes: 6 additions & 6 deletions tools/wheel_resolver/wheel_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
import tools.wheel_resolver.wheel as sut
import collections
import typing
import unittest
import unittest.mock
import distlib.locators
import distlib.database
Expand All @@ -13,7 +13,7 @@
)


class TestUrl:
class TestUrl(unittest.TestCase):
def _mock_locator(
self,
*,
Expand All @@ -36,7 +36,7 @@ def _mock_locator(
)

def test_no_distribution(self) -> None:
with pytest.raises(sut.DistributionNotFoundError):
with self.assertRaises(sut.DistributionNotFoundError):
sut.url(
package_name="",
package_version=None,
Expand All @@ -45,15 +45,15 @@ def test_no_distribution(self) -> None:
)

def test_no_compatible_urls(self) -> None:
with pytest.raises(sut.CompatibleUrlNotFoundError):
with self.assertRaises(sut.CompatibleUrlNotFoundError):
sut.url(
package_name="",
package_version=None,
tags=[],
locator=self._mock_locator(),
)

@pytest.mark.skip("caplog doesn't capture logging")
@unittest.skip("caplog doesn't capture logging")
def test_warns_multiple_compatible_urls(self, caplog) -> None:
with caplog.at_level(logging.WARNING, logger=sut.__name__):
sut.url(
Expand All @@ -73,7 +73,7 @@ def test_warns_multiple_compatible_urls(self, caplog) -> None:
assert len(caplog.records) > 0
assert any(x.level == logging.WARNING for x in caplog.records)

@pytest.mark.skip(
@unittest.skip(
"ordering and selection is unclear; this test case should be updated if we have a preference for a specific URL when collissions happen."
)
def test_preferred_url(self) -> None:
Expand Down