Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Installation documentation is unclear #554

Open
menzenski opened this issue Apr 23, 2024 · 1 comment
Open

Bug: Installation documentation is unclear #554

menzenski opened this issue Apr 23, 2024 · 1 comment

Comments

@menzenski
Copy link

Describe the bug

I'm new to testcontainers and have been working on getting it set up to run MongoDB tests in Python.

I found https://testcontainers.com/guides/getting-started-with-testcontainers-for-python/ which instructs to install testcontainers-postgres, so I searched PyPi for testcontainers-mongo, found https://pypi.org/project/testcontainers-mongodb/, installed it (specifically with poetry add --group dev testcontainers-mongod, which installed v0.0.1rc1), and started using it to write tests.

I then ran into errors when trying to set the username, password, and dbname kwargs, which the documentation says I should be able to set:

class MongoDbContainer(image: str = 'mongo:latest', port: int = 27017, username: str | None = None, password: str | None = None, dbname: str | None = None, **kwargs)

In searching around for a resolution to this issue I realized that testcontainers in PyPi was published just last week with v4.4.0, while testcontainers-mongodb (and other packages like testcontainers-postgres) have not been published to PyPi since January 2023, and are only v0.0.1rc1.

I looked up this GitHub repository, saw the mongodb extra, and then removed the testcontainers-mongodb I had installed previously, and installed testcontainers[mongodb] instead.

This resolved my issue in that I am now able to set the username, password, and dbname kwargs that I wanted to. But I wanted to log an issue here to raise a request for some clarity around the best way to install testcontainers for Python.

I'm happy to contribute some draft documentation but may need some direction on where/how that should be done.

@alexanderankin
Copy link
Collaborator

opened a PR to fix this: testcontainers/tc-guide-getting-started-with-testcontainers-for-python#3

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

No branches or pull requests

2 participants