diff --git a/pkgs/development/python-modules/html5lib/default.nix b/pkgs/development/python-modules/html5lib/default.nix
index f0abbcfbecce..1172b0195132 100644
--- a/pkgs/development/python-modules/html5lib/default.nix
+++ b/pkgs/development/python-modules/html5lib/default.nix
@@ -1,12 +1,11 @@
{ lib
, buildPythonPackage
, fetchPypi
-, flake8
-, pytest_4
-, pytest-expect
-, mock
, six
, webencodings
+, mock
+, pytest-expect
+, pytestCheckHook_5
}:
buildPythonPackage rec {
@@ -18,17 +17,16 @@ buildPythonPackage rec {
sha256 = "b2e5b40261e20f354d198eae92afc10d750afb487ed5e50f9c4eaf07c184146f";
};
- checkInputs = [ flake8 pytest_4 pytest-expect mock ];
propagatedBuildInputs = [
- six webencodings
+ six
+ webencodings
];
- checkPhase = ''
- # remove test causing error
- # https://github.com/html5lib/html5lib-python/issues/411
- rm html5lib/tests/test_stream.py
- py.test
- '';
+ checkInputs = [
+ mock
+ pytest-expect
+ pytestCheckHook_5
+ ];
meta = {
homepage = "https://github.com/html5lib/html5lib-python";
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index eb9e8bf2ec5c..fb435dedc248 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -137,6 +137,11 @@ in {
# it should not override the version of pytest that is used for say
# Python 2. This is an ugly hack that is needed now because the hook
# propagates the package.
+ pytestCheckHook_5 = if isPy3k then
+ self.pytestCheckHook.override { pytest = self.pytest_5; }
+ else
+ self.pytestCheckHook;
+
pytestCheckHook_6_1 = if isPy3k then
self.pytestCheckHook.override { pytest = self.pytest_6_1; }
else