Skip to content

ci: centralize pytest configuration in root#403

Merged
SilanHe merged 1 commit into
mainfrom
centralize-pytest-mark
May 29, 2026
Merged

ci: centralize pytest configuration in root#403
SilanHe merged 1 commit into
mainfrom
centralize-pytest-mark

Conversation

@SilanHe
Copy link
Copy Markdown
Contributor

@SilanHe SilanHe commented May 29, 2026

Issue #, if available:

Description of changes: We are getting new warnings for unknown pytest mark when running integration tests.

There are some warnings in the newest integration test CI workflow
packages/aws-durable-execution-sdk-python-examples/test/step/test_step.py:10
/home/runner/work/aws-durable-execution-sdk-python/aws-durable-execution-sdk-python/language-sdk/packages/aws-durable-execution-sdk-python-examples/test/step/test_step.py:10: PytestUnknownMarkWarning: Unknown pytest.mark.example - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
@pytest.mark.example Is this something caused by the mono repo change? There was no warning before (e.g. test run history) - @wangyb-A

For this PR, I'm moving duplicated [tool.pytest.ini_options] sections from sub-package pyproject.toml files to the root pyproject.toml. All pytest runs happen from the repo root, so markers, testpaths, and addopts only need to live in the root config.

Issue accidentally introduced in https://github.com/aws/aws-durable-execution-sdk-python/pull/397/changes#r3327105014

Testing: I ran the hatch run test:cov from the project root and there are no more warnings.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@SilanHe SilanHe changed the title ci: Centralize pytest configuration in root pyproject.toml ci: centralize pytest configuration in root May 29, 2026
@SilanHe SilanHe closed this May 29, 2026
@SilanHe SilanHe reopened this May 29, 2026
@SilanHe SilanHe force-pushed the centralize-pytest-mark branch from 55fc9fd to d61d0cd Compare May 29, 2026 22:41
@SilanHe SilanHe force-pushed the centralize-pytest-mark branch from d61d0cd to 55abd68 Compare May 29, 2026 22:43
Comment thread pyproject.toml
[tool.pytest.ini_options]
addopts = "--import-mode=importlib"
# Declare custom markers to avoid warnings with --strict-markers
addopts = "-v --strict-markers --import-mode=importlib"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious why we need --import-mode=importlib

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's because of the new monorepo, if we have tests in 2 packages with the same file name, they will normally collide since the --import-mode is by default prepend. importlib mode uses Python's importlib to import each test file as a unique module based on its full file path, so there's no collision.

https://docs.pytest.org/en/7.1.x/explanation/pythonpath.html

@SilanHe SilanHe merged commit 6bef3b2 into main May 29, 2026
74 of 76 checks passed
@SilanHe SilanHe deleted the centralize-pytest-mark branch May 29, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants