Skip to content

Commit

Permalink
pytest: Add some markers: ft, unit and stress
Browse files Browse the repository at this point in the history
Add some markers: ft, unit and stress. And mark
test_simple.test_simple_emerge with ft, such that those tests can be
triggered with::

   pytest -m ft

Signed-off-by: David Palao <[email protected]>
  • Loading branch information
palao committed Oct 26, 2023
1 parent 537ee2d commit 545d721
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions lib/portage/tests/emerge/test_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import subprocess
import sys

import pytest

import portage
from portage import shutil, os
from portage.const import (
Expand All @@ -29,12 +31,19 @@ def __init__(self, remote_path, local_path):
self._remote_path = remote_path
self._local_path = local_path

def __getitem__(self, request_path):
safe_path = os.path.normpath(request_path)
if not safe_path.startswith(self._remote_path + "/"):
raise KeyError(request_path)
local_path = os.path.join(
self._local_path, safe_path[len(self._remote_path) + 1 :]

@pytest.mark.ft
def test_simple_emerge(async_loop, playground, binhost, simple_command):
async_loop.run_until_complete(
asyncio.ensure_future(
_async_test_simple(
playground,
binhost,
simple_command,
_METADATA_XML_FILES,
loop=async_loop,
),
loop=async_loop,
)
try:
with open(local_path, "rb") as f:
Expand Down

0 comments on commit 545d721

Please sign in to comment.