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
7 changes: 5 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"pw": true,
"pw.bat": true
},
"chat.commandCenter.enabled": false,
"chat.disableAIFeatures": true,
"dprint.path": ".vscode/dprint", // https://github.com/dprint/dprint/issues/859#issuecomment-3194102785
"basedpyright.disableLanguageServices": true,
"git.blame.editorDecoration.enabled": true,
Expand All @@ -87,5 +87,8 @@
"tag:yaml.org,2002:python/name:material.extensions.emoji.twemoji",
"tag:yaml.org,2002:python/name:pymdownx.superfences.fence_code_format",
"tag:yaml.org,2002:python/object/apply:pymdownx.slugs.slugify mapping"
]
],
"json.schemaDownload.trustedDomains": {
"https://plugins.dprint.dev": true
}
}
6 changes: 3 additions & 3 deletions dprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
".basedpyright/baseline.json"
],
"plugins": [
"https://plugins.dprint.dev/json-0.21.0.wasm",
"https://plugins.dprint.dev/markdown-0.20.0.wasm",
"https://plugins.dprint.dev/json-0.23.0.wasm",
"https://plugins.dprint.dev/markdown-0.22.1.wasm",
"https://plugins.dprint.dev/toml-0.7.0.wasm",
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.1.wasm"
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.6.0.wasm"
]
}
2 changes: 1 addition & 1 deletion pw.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[main]
requirements = ["uv==0.11.8"]
requirements = ["uv==0.11.28"]
hash = "45210da832f9626829457a65e9e7c4d0"
7 changes: 6 additions & 1 deletion pytest_robotframework/_internal/robot/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
)
from pytest_robotframework._internal.errors import InternalError
from pytest_robotframework._internal.pytest.exception_getter import exception_key
from pytest_robotframework._internal.pytest.utils import pytest_version

if TYPE_CHECKING:
from pytest_robotframework._internal.robot.utils import Cloaked
Expand Down Expand Up @@ -98,7 +99,11 @@ def run_test(arg: Cloaked[Item]):
reports = item.stash[_report_key]
if reports[0].passed:
if item.config.getoption("setupshow", default=False):
show_test_item(item)
if pytest_version >= (9, 1):
setup_only = item.config.getoption("setuponly", default=False)
show_test_item(item, add_space=not setup_only)
else:
show_test_item(item) # ty:ignore[missing-argument] #pyright:ignore[reportCallIssue]
if not item.config.getoption("setuponly", default=False):
_call_and_report_robot_edition(item, "call")

Expand Down
6 changes: 4 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
if TYPE_CHECKING:
from os import PathLike

# only available in pytest >=9.1
from _pytest.pytester import _FileContent # pyright:ignore[reportPrivateUsage]
from _typeshed import StrPath
from lxml._types import ( # pyright:ignore[reportMissingModuleSource] https://github.com/DetachHead/basedpyright/issues/615
_TextArg, # pyright: ignore[reportPrivateUsage]
Expand Down Expand Up @@ -89,7 +91,7 @@ class PytesterDir(Pytester): # pyright:ignore[reportGeneralTypeIssues] #ty:igno
"""

@override
def makepyfile(self, *args: Never, **kwargs: Never) -> Never: ...
def makepyfile(self, *args: _FileContent, **kwargs: _FileContent) -> Path: ...

@override
def makefile(self, ext: str, *args: str, **kwargs: str) -> Never: ...
Expand All @@ -101,7 +103,7 @@ def makeini(self, source: str) -> Never: ...
def makepyprojecttoml(self, source: str) -> Never: ...

@override
def maketxtfile(self, *args: Never, **kwargs: Never) -> Never: ...
def maketxtfile(self, *args: _FileContent, **kwargs: _FileContent) -> Never: ...

@override
def runpytest(self, *args: str | PathLike[str], **kwargs: Never) -> Never: ...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
@contextmanager
def asdf() -> Iterator[None]:
logger.info("start")
yield
raise Exception("asdf")
try:
yield
finally:
raise Exception("asdf")


def test_foo():
Expand Down
11 changes: 8 additions & 3 deletions tests/test_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
from re import search
from typing import TYPE_CHECKING, cast

# on pytest <9 this function is defined here and on >=9 it's defined in _pytest.compat
# so we intentionally rely on an implicit re-export so it works in both cases
from _pytest.assertion.util import running_on_ci # pyright: ignore[reportPrivateImportUsage]
from pytest import ExitCode, MonkeyPatch, mark, skip

from pytest_robotframework._internal.pytest.utils import pytest_version
Expand All @@ -25,6 +22,14 @@
from tests.conftest import PytesterDir


if pytest_version < (9,):
from _pytest.assertion.util import (
running_on_ci, # pyright: ignore[reportAttributeAccessIssue,reportUnknownVariableType] # ty:ignore[unresolved-import]
)
else:
from _pytest.compat import running_on_ci


def test_one_test_passes(pr: PytestRobotTester):
pr.run_and_assert_result(passed=1)
pr.assert_log_file_exists()
Expand Down
887 changes: 442 additions & 445 deletions uv.lock

Large diffs are not rendered by default.

Loading