Skip to content

Commit d7f57be

Browse files
Mayankm96Edify0991
authored andcommitted
Moves pytest configuration to pyproject.toml (isaac-sim#4376)
# Description This MR moves pytest configuration to pyproject.toml to avoid many project infrastructure files. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there
1 parent 7e1f91e commit d7f57be

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,9 @@ skip = '*.usd,*.usda,*.usdz,*.svg,*.png,_isaac_sim*,*.bib,*.css,*/_build'
168168
quiet-level = 0
169169
# the world list should always have words in lower case
170170
ignore-words-list = "haa,slq,collapsable,buss,reacher"
171+
172+
[tool.pytest.ini_options]
173+
174+
markers = [
175+
"isaacsim_ci: mark test to run in isaacsim ci",
176+
]

pytest.ini

Lines changed: 0 additions & 3 deletions
This file was deleted.

source/isaaclab/isaaclab/app/app_launcher.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -795,17 +795,16 @@ def _create_app(self):
795795
sys.stdout = open(os.devnull, "w") # noqa: SIM115
796796

797797
# pytest may have left some things in sys.argv, this will check for some of those
798-
# do a mark and sweep to remove any -m pytest and -m isaacsim_ci and -c **/pytest.ini
798+
# do a mark and sweep to remove any -m pytest and -m isaacsim_ci and -c **/pyproject.toml
799799
indexes_to_remove = []
800800
for idx, arg in enumerate(sys.argv[:-1]):
801801
if arg == "-m":
802802
value_for_dash_m = sys.argv[idx + 1]
803803
if "pytest" in value_for_dash_m or "isaacsim_ci" in value_for_dash_m:
804804
indexes_to_remove.append(idx)
805805
indexes_to_remove.append(idx + 1)
806-
if arg == "-c" and "pytest.ini" in sys.argv[idx + 1]:
806+
if arg.startswith("--config-file=") and "pyproject.toml" in arg:
807807
indexes_to_remove.append(idx)
808-
indexes_to_remove.append(idx + 1)
809808
if arg == "--capture=no":
810809
indexes_to_remove.append(idx)
811810
for idx in sorted(indexes_to_remove, reverse=True):

tools/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,13 @@ def run_individual_tests(test_files, workspace_root, isaacsim_ci):
151151
)
152152

153153
# Prepare command
154+
# Note: Command options matter as they are used for cleanups inside AppLauncher
154155
cmd = [
155156
sys.executable,
156157
"-m",
157158
"pytest",
158159
"--no-header",
159-
"-c",
160-
f"{workspace_root}/pytest.ini",
160+
f"--config-file={workspace_root}/pyproject.toml",
161161
f"--junitxml=tests/test-reports-{str(file_name)}.xml",
162162
"--tb=short",
163163
]

0 commit comments

Comments
 (0)