sdk: `test_tutorials.py` is effectively no-op

Open Beginner friendly
#634 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
testing

Research direction

Start with sdk/test/examples/test_tutorials.py, especially test_tutorial_create_simple_aas() and the imports removed by the Ruff reformatting in #601. Restore the tutorial imports with # noqa: F401, then review the other changes from #601 for similar removals and run the tutorial tests to verify they execute and check their results.

Written by the indexing model from the issue text.

Description

We have a test file sdk/test/examples/test_tutorials.py, that checks the tutorials under sdk/basyx/aas/examples run without errors and produce correct results.
Because the tutorials are written as plain script files that do not wrap the execution inside a if __name__ == "__main__" guard,
the testing works by simply importing the tutorial file.

See test_tutorial_create_simple_aas() as example:
https://github.com/eclipse-basyx/basyx-python-sdk/blob/29eda6f00f175e4488502a470acc93d1648e4e8d/sdk/test/examples/test_tutorials.py#L24-L30

The reformatting with ruff in #601 removed these imports as they seem unused to the linter. Therefore, most of the tests are currently no-ops.
https://github.com/eclipse-basyx/basyx-python-sdk/blob/29eda6f00f175e4488502a470acc93d1648e4e8d/sdk/test/examples/test_tutorials.py#L34-L37

We should reintroduce the imports, guard them by # noqa: F401 and also re-check the changes from #601 for other unwanted removals.

Dominant language
Python
Stars
102
Forks
52
Avg merge
20d 17h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from eclipse-basyx/basyx-python-sdk

All issues in eclipse-basyx/basyx-python-sdk

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.