Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ dependencies = [
[tool.hatch.build.targets.wheel]
packages = ["src"]

[tool.pytest.ini_options]
testpaths = ["test"]
addopts = "-v --strict-markers"
pythonpath = ["."]
markers = [
"example: marks tests as example tests (deselect with '-m \"not example\"')",
"durable_execution: marks tests that use the durable_runner fixture (not used for test selection)",
]

[tool.hatch.envs.examples.scripts]
cli = "python cli.py {args}"
bootstrap = "python cli.py bootstrap"
Expand Down
4 changes: 0 additions & 4 deletions packages/aws-durable-execution-sdk-python-otel/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,3 @@ lines-after-imports = 2
"SIM117",
"TRY301",
]

[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-v --strict-markers"
13 changes: 0 additions & 13 deletions packages/aws-durable-execution-sdk-python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,3 @@ lines-after-imports = 2
"SIM117",
"TRY301",
]

[tool.pytest.ini_options]
# Declare custom markers to avoid warnings with --strict-markers
markers = [
# Used for test selection with -m example
"example: marks tests as example tests (deselect with '-m \"not example\"')",
# Used for configuration - passes handler and lambda_function_name to durable_runner fixture
"durable_execution: marks tests that use the durable_runner fixture (not used for test selection)",
]
# Default test discovery paths
testpaths = ["tests"]
# Default options for all test runs
addopts = "-v --strict-markers"
10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@ cov = "pytest --cov-report=term-missing --cov {args}"
examples-integration = "pytest --runner-mode=cloud -m example packages/aws-durable-execution-sdk-python-examples/test/ -v {args}"

[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

testpaths = [
"packages/aws-durable-execution-sdk-python/tests",
"packages/aws-durable-execution-sdk-python-otel/tests",
"packages/aws-durable-execution-sdk-python-examples/test",
]

markers = [
# Used for test selection with -m example
"example: marks tests as example tests (deselect with '-m \"not example\"')",
# Used for configuration - passes handler and lambda_function_name to durable_runner fixture
"durable_execution: marks tests that use the durable_runner fixture (not used for test selection)",
]

[tool.hatch.envs.types]
workspace.members = ["packages/*"]
Expand Down