Skip to content

Instantly share code, notes, and snippets.

@cdleonard
Last active March 8, 2024 11:25
Show Gist options
  • Save cdleonard/941dd2df169561cc96b3cb4ab1890cf0 to your computer and use it in GitHub Desktop.
Save cdleonard/941dd2df169561cc96b3cb4ab1890cf0 to your computer and use it in GitHub Desktop.
Check compatibility between pytest-asyncio and --doctest-ignore-import-error

Check compatibility between pytest-asyncio and --doctest-ignore-import-errors

The installation of the pytest-asyncio package should not affect this.

print("import baddepmod")
import baddep
services:
fail:
build:
context: .
dockerfile: Dockerfile.fail
volumes:
- "./:/workdir"
working_dir: /workdir
pass:
build:
context: .
dockerfile: Dockerfile.pass
volumes:
- "./:/workdir"
working_dir: /workdir
FROM python:alpine
RUN pip install pytest pytest-asyncio
FROM python:alpine
RUN pip install pytest
def test_add():
assert 1 + 1 == 2
#! /bin/bash
docker compose run --rm --build pass pytest --co
docker compose run --rm --build fail pytest --co
[tool:pytest]
minversion = 6
addopts =
--capture=no
--doctest-modules
--doctest-ignore-import-errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment