avast / avast/pytest-docker

Export default setup/cleanup commands at base module level

Open
#120 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
489
Forks
77
PR merge metrics
No merged PRs in 30d

Description

Hi, my feature request is related to merged PR https://github.com/avast/pytest-docker/pull/119. Basically I’m asking if you’d be ok to export more names at the main module level in `__init__.py`, for example:
```python
__all__ = [
...
"get_setup_command",
"get_cleanup_command",
]
```
to gain access to the plugin’s default commands.

For context: these come in handy for setups like
```python
@pytest.fixture(scope="session")
def docker_setup() -> str | list[str]:
if os.getenv("GITHUB_ACTIONS") == "true":
return []
return pytest_docker.plugin.get_setup_command() # return pytest_docker.get_setup_command()
```
so that I don’t need to reach into the `plugin` module. (See also https://github.com/avast/pytest-docker/issues/80.)

I can provide a PR again.

Contributor guide

No contributing guide indexed for this repository

Research direction

Inspect the package __init__.py and the plugin module to confirm how get_setup_command and get_cleanup_command are currently exposed. Export both names at the base module level, then verify that callers can import and invoke them without reaching into pytest_docker.plugin.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
testing
Issue type
Feature
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.