ci: centralize pytest configuration in root#403
Merged
Conversation
55fc9fd to
d61d0cd
Compare
d61d0cd to
55abd68
Compare
zhongkechen
approved these changes
May 29, 2026
| [tool.pytest.ini_options] | ||
| addopts = "--import-mode=importlib" | ||
| # Declare custom markers to avoid warnings with --strict-markers | ||
| addopts = "-v --strict-markers --import-mode=importlib" |
Contributor
There was a problem hiding this comment.
curious why we need --import-mode=importlib
Contributor
Author
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Description of changes: We are getting new warnings for unknown pytest mark when running integration tests.
For this PR, I'm moving duplicated
[tool.pytest.ini_options]sections from sub-packagepyproject.tomlfiles to the rootpyproject.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:covfrom 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.