Skip to content

Commit

Permalink
Apply some cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
ionelmc committed Mar 1, 2022
1 parent 487f731 commit 9c1d43e
Showing 1 changed file with 9 additions and 31 deletions.
40 changes: 9 additions & 31 deletions tests/test_tox_wheel.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import sys

import pytest
import sys

import tox_wheel.plugin

Expand Down Expand Up @@ -218,7 +217,6 @@ def test_enabled_toxini(testdir_legacy, options):
assert 'is not a supported wheel on this platform.' not in result.stderr.str()


@pytest.mark.xfail
def test_skip_missing_interpreters():
with patch.object(tox_wheel.plugin, 'get_package') as mock_build:
venv = MagicMock()
Expand All @@ -228,7 +226,6 @@ def test_skip_missing_interpreters():
session.getvenv.return_value = object()
mock_build.side_effect = tox_wheel.plugin.InterpreterNotFound("No interpreter")


with pytest.raises(tox_wheel.plugin.InterpreterNotFound):
tox_wheel.plugin.get_package(session)

Expand All @@ -240,12 +237,7 @@ def test_skip_missing_interpreters():
tox_wheel.plugin.tox_package(session, venv)


@pytest.fixture(params=[True, False], ids=['skips', 'no-skips'])
def skip_missing(request):
return request.param


def test_multiplex_sdist_and_wheel(testdir_legacy, options, skip_missing):
def test_multiplex_sdist_and_wheel(testdir_legacy, options):
testdir_legacy.tmpdir.join('tox.ini').write("""
[tox]
envlist =
Expand All @@ -254,35 +246,21 @@ def test_multiplex_sdist_and_wheel(testdir_legacy, options, skip_missing):
skip_missing_interpreters = True
[testenv]
[testenv:a]
wheel = false
[testenv:b]
wheel = true
[testenv:missing_interpreter]
basepython = python3.nothing
""")
options[options.index('-e') + 1] = 'py-a,py-b,missing_interpreter'

result = testdir_legacy.run('tox', '-vv', *options)
assert result.ret == 0, result.stdout


def test_multiplex_sdist_and_wheel(testdir_legacy, options):
testdir_legacy.tmpdir.join('tox.ini').write("""
[tox]
envlist =
py-a-{sdist, whl}
[testenv:sdist]
wheel = false
[testenv:whl]
wheel = true
""")
options[options.index('-e') + 1] = 'py-a-sdist,py-a-whl'
assert 'py-a,py-b' in options
options[options.index('py-a,py-b')] = 'py-a,py-b,missing_interpreter'

result = testdir_legacy.run('tox', '-vv', *options)
result.stdout.fnmatch_lines([
'GLOB sdist-make: *',
'*Building wheels*',
])
assert result.ret == 0, result.stdout.str()
assert result.ret == 0, result.stdout

0 comments on commit 9c1d43e

Please sign in to comment.