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

Run separate test suites for optional requirements #1389

Open
Ruwann opened this issue Jul 6, 2021 · 1 comment
Open

Run separate test suites for optional requirements #1389

Ruwann opened this issue Jul 6, 2021 · 1 comment
Labels

Comments

@Ruwann
Copy link
Member

Ruwann commented Jul 6, 2021

The tests are currently run using an environment in which all packages are installed, including optional ones such as aiohttp. This could lead to some tests passing while they shouldn't. For example, see #1377 .

We should run the tests that don't require any optional dependencies in an environment in which they are not installed, and tests that do require optional dependencies, should be run separately.

Some ways of achieving this:

@RobbeSneyders
Copy link
Member

I originally proposed pytest.mark instead of pytest.skip since skipping tests is silent. If we don't install the optional dependencies correctly in the test environment, the tests will just be skipped instead of failing.

You can mark complete modules as well, don't know if that solves the ImortError issue?

Final option is to ignore specific paths via command line arguments. This is probably the easiest approach if we only need to ignore the aiohttp directory, but is not really suited for more complex setups.

RobbeSneyders added a commit that referenced this issue Mar 6, 2023
This PR delays import errors for the optional Flask dependency, so you
can use the AsyncApp without Flask installed.

This issue is hidden in our tests since we install all extras. To
prevent this, we need to address
#1389.
RobbeSneyders added a commit that referenced this issue Mar 6, 2023
We use `asgiref` as a direct dependency

https://github.com/spec-first/connexion/blob/ab94e2aaa67d30ab2bb97e4d8d27746a5ed43d20/connexion/decorators/main.py#L7

So should add it explicitly as well.

This issue is hidden in our tests since we install all extras. To
prevent this, we need to address
#1389.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants