Overriding a Python package in propagatedBuildInputs is a bad idea as you may end up with multiple versions in your closure. This happened, and when installing to $out the package for which the tests were run, the site packages folder was empty. Possible improvement is to add the tests as a separate derivation.