-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: pass doctests, s/doctest/doctests/, run them in gha, s/asyncpg/p…
…sycopg/ in doctest, fix keycloak flakiness: wait for first user (#505) Doctests are run as interpreted code from docstrings. In order to run these tests, libraries need to be available for the example code, and usage of async code either needs to be wrapped in an `asyncio` call or avoided completely. This PR fixes up all failing doctests and makes `make doctests` target run successfully again. Summary: - Renames Make target `doctest` to `doctests` to follow naming convention from `tests` target - Adds `doctests` step to Github Action workflow runs - Replaces `asyncpg` example from `index.rst` with `psycopg` to be able to run as a doctest. Also added `psycopg` as dev dependency (`asyncpg` was already missing from here) - Fixes Keycloak doctest by providing expected output, also did the same for regular test - Also: Fixed `wait_for_container` method in `Keycloak` module to actually wait for the first user to be created (in order to be able to authenticate at all) before returning the started container, if the command is `dev-start`. This is needed in order to prevent race conditions in flaky tests and for the sample usage code.
- Loading branch information
Showing
11 changed files
with
59 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import sys | ||
|
||
import pytest | ||
|
||
from testcontainers.postgres import PostgresContainer | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,8 @@ description = "Python library for throwaway instances of anything that can run i | |
authors = ["Sergey Pirogov <[email protected]>"] | ||
maintainers = [ | ||
"Balint Bartha <[email protected]>", | ||
"David Ankin <[email protected]>" | ||
"David Ankin <[email protected]>", | ||
"Vemund Santi <[email protected]>" | ||
] | ||
readme = "README.md" | ||
keywords = ["testing", "logging", "docker", "test automation"] | ||
|
@@ -120,6 +121,7 @@ anyio = "^4.3.0" | |
psycopg2-binary = "*" | ||
pg8000 = "*" | ||
sqlalchemy = "*" | ||
psycopg = "*" | ||
kafka-python = "^2.0.2" | ||
|
||
[[tool.poetry.source]] | ||
|