Skip to content

Suite initialization files __init__.robot.md and __init__.robot.rst are ignored #5853

Description

@d-biehl

A directory of Markdown or reStructuredText suites cannot have an initialization file in the same format: __init__.robot.md and __init__.robot.rst are silently ignored. .robot.md and .robot.rst files are parsed by default, and the User Guide says that an initialization file name has the format __init__.ext, where the extension is one of the supported file formats (User Guide).

Example:

tests/
├── __init__.robot.md
└── example.robot.md

tests/__init__.robot.md:

```robotframework
*** Settings ***
Documentation    Init documentation
Suite Setup      Log    init setup
```

tests/example.robot.md:

# Suite

```robotframework
*** Test Cases ***
Example
    Log    hello
```
$ robot tests
==============================================================================
Tests
==============================================================================
Tests.Example
==============================================================================
Example                                                               | PASS |

The suite Tests has no documentation and no suite setup. I would expect __init__.robot.md to be used as the initialization file, just like __init__.robot. The same happens with __init__.robot.rst next to .robot.rst suites.

Cause

A file is an initialization file when its stem is __init__ (code). stem only removes the last suffix, so the stem of __init__.robot.md is __init__.robot. Because the name starts with _, the file is then skipped like other ignored files. With .robot.rst this exists since Robot Framework 6.1, which started to parse .robot.rst files by default; with .robot.md since Robot Framework 7.5.

Possible fix

Compare the file name with __init__. plus the matched extension, which ValidExtensions.get_extension() already returns. I tried this locally: __init__.robot.md and __init__.robot.rst are then used as initialization files, and __init__.robot still works.

Versions

Tested with Robot Framework 7.5.1 (Python 3.14) and the current master (084538c, Python 3.14).

If you agree with the direction, I could prepare a pull request with a fix and acceptance tests.


AI/tooling disclosure: This issue was prepared with assistance from Claude Code. I reviewed the result manually, understand the reported problem, and verified it locally.

Activity

  1. added this to the v7.6 milestone on Nov 10, 2026
  2. added theissue type on Nov 10, 2026
  3. pekkaklarck commented on Nov 10, 2026

    @pekkaklarck
    Member

    Good catch. Can you create a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions