While packaging json-logging for NixOS, I've come across two issues with tests. Since neither are specific to NixOS (though they may be an artifact of how the build environment is set up), I felt it'd be better to try to stream the fixes up.
While testing, the import test for Quart finds not the 'quart' package, but tests/smoketests/quart. It's been a while since I worked on this, but it seems to happen because pytest prepends the test module directory to sys.path by default. To make it work with a default pytest invocation, we can simply try to import something only the real quart package provides.
If no smoketest backends are specified, it will try to find tests in a __pycache__ directory if it exists.
While packaging json-logging for NixOS, I've come across two issues with tests. Since neither are specific to NixOS (though they may be an artifact of how the build environment is set up), I felt it'd be better to try to stream the fixes up.
tests/smoketests/quart
. It's been a while since I worked on this, but it seems to happen because pytest prepends the test module directory tosys.path
by default. To make it work with a default pytest invocation, we can simply try to import something only the real quart package provides.__pycache__
directory if it exists.