diff --git a/_multibuild b/_multibuild
new file mode 100644
index 0000000..fcc7b97
--- /dev/null
+++ b/_multibuild
@@ -0,0 +1,3 @@
+
+ test
+
diff --git a/python-hypothesis.changes b/python-hypothesis.changes
index d49fbab..d9d181a 100644
--- a/python-hypothesis.changes
+++ b/python-hypothesis.changes
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Sun Sep 9 22:39:31 CEST 2018 - Matěj Cepl
+
+- Add multibuild to allow running tests.
+
-------------------------------------------------------------------
Sat Sep 8 19:08:09 UTC 2018 - Arun Persaud
diff --git a/python-hypothesis.spec b/python-hypothesis.spec
index da6efff..1c122cc 100644
--- a/python-hypothesis.spec
+++ b/python-hypothesis.spec
@@ -23,10 +23,19 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define oldpython python
%bcond_without python2
-# Unfortunately we cannot test by default, because of the circular
-# dependency on pytest
+
+%global flavor @BUILD_FLAVOR@%{nil}
+%if "%{flavor}" == "test"
+%define test 1
+%bcond_without test
+%else
%bcond_with test
+%endif
+%if %{with test}
+Name: python-hypothesis-%{flavor}
+%else
Name: python-hypothesis
+%endif
Version: 3.71.0
Release: 0
Summary: A library for property based testing
@@ -53,6 +62,7 @@ BuildRequires: %{python_module coverage}
BuildRequires: %{python_module flaky}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module pytest >= 3.0.0}
+BuildRequires: python3-Django
%endif
# /SECTION
%if %{with python2}
@@ -89,16 +99,19 @@ $python -O -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/hy
%fdupes %{buildroot}%{$python_sitelib}
}
-%if %{with test}
%check
+%if %{with test} && ! %{with python2}
%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib}
-py.test-%{$python_bin_suffix} test
+py.test-%{$python_bin_suffix} tests
}
+rm -rf %{buildroot}%{_datarootdir}/python*
%endif
%files %{python_files}
-%doc ../CITATION README.rst
%license ../LICENSE.txt
+%if !%{with test}
+%doc ../CITATION README.rst
%{python_sitelib}/hypothesis*
+%endif
%changelog