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-pluggy.changes b/python-pluggy.changes
index 7931ddb..bd526d3 100644
--- a/python-pluggy.changes
+++ b/python-pluggy.changes
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Mon Feb 25 08:23:41 UTC 2019 - Tomáš Chvátal
+
+- Switch to multibuild in order to avoid build loop
+
-------------------------------------------------------------------
Tue Feb 12 14:20:45 UTC 2019 - Tomáš Chvátal
diff --git a/python-pluggy.spec b/python-pluggy.spec
index 56643e4..2265e9c 100644
--- a/python-pluggy.spec
+++ b/python-pluggy.spec
@@ -17,7 +17,15 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
-Name: python-pluggy
+%global flavor @BUILD_FLAVOR@%{nil}
+%if "%{flavor}" == "test"
+%define psuffix -test
+%bcond_without test
+%else
+%define psuffix %{nil}
+%bcond_with test
+%endif
+Name: python-pluggy%{psuffix}
Version: 0.8.1
Release: 0
Summary: Plugin registration and hook calling mechanisms for Python
@@ -25,12 +33,14 @@ License: MIT
Group: Development/Languages/Python
URL: https://github.com/pytest-dev/pluggy
Source: https://files.pythonhosted.org/packages/source/p/pluggy/pluggy-%{version}.tar.gz
-BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildArch: noarch
+%if %{with test}
+BuildRequires: %{python_module pytest}
+%endif
%python_subpackages
%description
@@ -47,15 +57,21 @@ except extensive docstrings in the pluggy.py module.
%python_build
%install
+%if !%{with test}
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
+%endif
%check
+%if %{with test}
%python_exec -m pytest testing
+%endif
+%if !%{with test}
%files %{python_files}
%license LICENSE
%doc README.rst CHANGELOG.rst
%{python_sitelib}/*
+%endif
%changelog