diff --git a/python-html5lib.spec b/python-html5lib.spec
index 62fcfed..fc5d0c6 100644
--- a/python-html5lib.spec
+++ b/python-html5lib.spec
@@ -47,6 +47,7 @@ BuildRequires: python3-setuptools
# Test deps
BuildRequires: python3-mock
BuildRequires: python3-pytest
+BuildRequires: python3-pytest-expect
BuildRequires: python3-six
BuildRequires: python3-webencodings
@@ -76,7 +77,10 @@ specification for maximum compatibility with major desktop web browsers.
%check
-# we don't have pytest-expect, this is hack, TODO: package pytest-expect
+# we have python3-pytest-expect, so python3 tests first
+%{__python3} -m pytest
+
+# we don't have python2-pytest-expect, this is a workaround
sed -i \
-e 's/config.option.update_xfail/False/' \
-e 's/^fail_if_missing_pytest_expect.*//' \
@@ -86,10 +90,9 @@ sed -i \
mv html5lib/tests/testdata{,_nope}
mkdir -p html5lib/tests/testdata/encoding/chardet/
cp html5lib/tests/testdata{_nope,}/encoding/chardet/test_big5.txt
-# hack ends here
+# workaround ends here
%{__python2} -m pytest
-%{__python3} -m pytest
%files -n python2-%{srcname}