Skip to content

Commit

Permalink
Simplify integration test for zop interface
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Jun 19, 2024
1 parent 06fd687 commit 051e70d
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions pkg_resources/tests/test_integration_zope_interface.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
import platform
import subprocess
import sys
from inspect import cleandoc

import jaraco.path
import pytest

pytestmark = pytest.mark.integration

VIRTUALENV = (sys.executable, "-m", "virtualenv")


def run(cmd, **kwargs):
proc = subprocess.run(cmd, encoding="utf-8", capture_output=True, **kwargs)
if proc.returncode != 0:
pytest.fail(f"Command {cmd} failed with:\n{proc.stdout=!s}\n{proc.stderr=!s}")
return proc.stdout


@pytest.mark.skipif(
platform.system() != "Linux",
Expand Down Expand Up @@ -55,7 +44,7 @@ def bar():
}
}
jaraco.path.build(project, prefix=tmp_path)
cmd = [venv.exe("pip"), "install", "-e", ".", "--no-use-pep517"]
run(cmd, cwd=tmp_path / "pkg")
out = run([venv.exe("foo")])
cmd = ["pip", "install", "-e", ".", "--no-use-pep517"]
venv.run(cmd, cwd=tmp_path / "pkg") # Needs this version of pkg_resources installed
out = venv.run(["foo"])
assert "Print me if you can" in out

0 comments on commit 051e70d

Please sign in to comment.