Skip to content

[pull] master from robotframework:master #145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1,492 commits into
base: master
Choose a base branch
from

Conversation

pull[bot]
Copy link

@pull pull bot commented May 10, 2022

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull bot added the ⤵️ pull label May 10, 2022
@squash-labs
Copy link

squash-labs bot commented Feb 14, 2023

Manage this branch in Squash

Test this branch here: https://master-n02a3.squash.io

martinezlc99 and others added 28 commits October 28, 2024 14:56
According to the [docs](https://typing.readthedocs.io/en/latest/spec/distributing.html#library-interface-public-and-private-symbols), we could have listed everything in `__all__` as well, but using redundant import aliases like `from x.y import z as z` was considered easier to maintain.

Fixes #5245.

---------

Co-authored-by: lcmartin <luis.martinez@collins.com>
Also make sure messages logged normally are always converted to
strings. This means that something like `logger.info(None)` logs a
string `None` instead of the message being discarded.

Fixes #5251.
`TypeConverters` gets `languages` that can be a `Languages` instance
or `None`. In the latter case a new `Languages` instance is needed if
someone accesses `TypeConverters.languages`. Earlier `Languages` was
created already in `__init__`, but now it is done only if
`TypeConverter.languages` is actually accessed.

This doesn't affect execution at all, because then `langauges` is
always a `Languages` instance. With Libdoc `languages` is always
`None` and `TypeConverters.languages` is never accessed, so lazy
initialization saves time. Apparently initializing `Languages` is
rather slow, because this causes roughly 50% performance enhancement
with really big libraries. Investigating why initialization is so slow
could be a good idea, but this fix makes sense anyway.

Fixes #5254.
No need to go through what languages would be available if no custom
language has been used. This would be an OK fix for Libdoc performance
degradation (#5254), but the fix in the previous commit is even
better. Anyway, this change makes sense on its own as well.
Earlier failure in suite setup initiated exit-on-failure even if all
tests would have skip-on-failure active.

Fixes #5170.
Earlier these lines could only contain one data token. That meant that
having two spaces after `Language:` didn't work. Now values from all
tokens are joined together.

Fixes #5202.
Also test with bytearray in addition to bytes.
For example, `${x}${y}${z}` now yields bytes if all variables are
bytes or bytearrays. If any of them is somethign else, or if there's a
constant string like in `${x}-${y}`, the result is a string.
Earlier the result was a string in all these cases.

Fixes #5259.
Now all bytes are mapped to Unicode code points with the same ordinal
(which is same as Latin-1 encoding). Earlie only the bytes in the
ASCII range were handled that way and other bytes were shown in an
escaped format.

Fixes #5052.
Earlier execution stopped if there was a SKIP and the test got the SKIP status as well. Now all iterations are executed and the final status is:
- FAIL is any iteration failed.
- PASS if any iteration succeeded and there were no FAILs.
- SKIP if all iterations succeeded.

This is similar to how suite status is calculated based on test statuses.

Fixes #4426.
---------

Co-authored-by: elajolh <lajos.olah@ericsson.com>
#5220)

Fixes #5007.

---------

Co-authored-by: Marcin Gmurczyk <mgmuras@gmail.com>
- Remove unnecessary options from `Run Tests`.
- Move `skip_with_templates.robot` away from the `skip` folder to
  avoid executing it unnecessarily when running normal skip tests.
curl and zip apparently were used by old report/log upload setup, but
the new rflogs based setup shouldn't need them.

Installing zip failed on Windows on the latest run so hopefully this
fixes that problem.
curl and zip were used by old report/log upload setup, but the new
rflogs based setup doesn't need them.
- PyPy 3.8 -> PyPy 3.10
- Python used as the runner to Python 3.13
It should have been removed when --critical was removed, but
apparenlty it was left here by accident.
Affects using `--skip` and `--skip-on-failure` options as well as
`robot:skip` and `robot:skip-on-failure` tags. Messages are now
consistent and the used tags are shown.

Fixes #5264.
pekkaklarck and others added 30 commits April 1, 2025 00:39
Earlier nested converters were stored in different ways depending on
the converter. These instance attributes existed:

- converter: TypeConverter | None
- converters: tuple[TypeConverter, ...]
- converters: dict[str, TypeConverter]
- converters: list[tuple[Any, TypeConverter]]

After this commit, attributes are:

- nested: list[TypeConverter]
- nested: dict[str, TypeConverter]

This makes it a lot easier to have generic code that inspects nested
converters. That, on the other hand, makes it easy to allow
configuring how unknown nested types like `list[Unknown]` are
handled. They are accepted in library keyword arguments, but with
variables (#3278) that should be an error.

The current design still has two problems:

- It would be better to have uniform type for `nested`. Currently most
  TypeConverters use a list, but TypedDictConverter needs to map keys
  to converters and uses a dict. We probably could avoid that by
  storing the key to an optional attribute in TypeConverter and using
  a list, but that would then make finding a right converter for a key
  a bit more complicated and slower.

- With TypeInfo normal nested converts are in `nested`, but
  TypedDictInfo uses separate `annotations`. That's inconsistent to
  TypeConverters, but changing that is not trivial. The reason is that
  unlike TypeConverter, TypeInfo is part of the public API so changes
  need to take backwards compatibility into account. That change would
  also affect Libdoc code and possibly also Libdoc spec files. This
  isn't worth the effort now, bu can be considered later, preferably
  in a major release.
Earlier `TypeInfo.get_converter` (and `TypeInfo.convert` that uses it)
raised a TypeError if there was no converter for the type itself, but
didn't care about possible nested unknown converters. Now handling
unknown types is configurable:

- If `allow_unknown` is False (default), a TypeError is raised if the
  type itself or any of its nested types have no converter. This makes
  it easy to reject types like `list[Unknown]`, which is something we
  want to do in variable conversion (#3278).

- If `allow_unknown` is True, a special `UnknownConverter` is returned
  and its `convert` returns the original value as-is.

These changes required adapting the argument conversion logic to avoid
changes affecting corner cases like `arg: Unknown = None`.
- Fix problem if variabe name contains characters also in the keyword
  name. This typically occurs only with embedded arguments. Fixes #5330.

- Fix using embedded arguments that use custom patterns with variables
  using inline Python evaluation syntax. Fixes #5394.

- Add tests for using embedded arguments with variables and other
  content. This unfortunately doesn't work if embedded arguments use
  custom patterns (#5396).

Above problems were fixed by replacing variables with placeholders before
matching keywords and then replacing placeholders with original variables
afterwards. With custom patterns also automatically added pattern that
matched variables (and failed to match the inline evaluation syntax)
needed to be updated to match the placeholder instead.
- Remove dead code.
- Fix language.
…uages-in-help

Feat: libdoc dynamic languages in help
Avoid conflict with Python's standard exception with the same name.

Related to #5377.
This is related to #5393. Problems were discovered when unit tests
didn't succeed on Python 3.8. Investigation reveladed this:

1. Python 3.8 doesn't have Annotated that was used in a test that
   validated the fix for #5393.

2. Annotated can be imported from typing_extensions in tests, but
   it turned out that Python 3.8 get_origin and get_args don't handle
   it properly so test continued to fail.

3. A fix for the above was trying to import also get_origin and get_args
   from typing_extensions on Python 3.8. That fixed the provious problem,
   but string representation was still off.

4. It turned out that our type_name and type_repr didn't handle Annotated
   and TypeRef properly. Most likely the same issue occurred also with
   other parameterized special forms.
Don't remove existing SUITE scope variables with same name.

Fixes #5399.
`Process.run_process` signature will change as part of #5412. Better
to use a custom library in Libdoc tests instead.
See issue #3278. User Guide documentation still missing and some cleanup to be done.
- Enhance error reporting with embedded args having invalid type.
- Consistent test case naming style.
- Some code cleanup.

Part of #3278.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.