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-mkdocs-material-extensions.changes b/python-mkdocs-material-extensions.changes
index dbd7739..2daee83 100644
--- a/python-mkdocs-material-extensions.changes
+++ b/python-mkdocs-material-extensions.changes
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Tue Mar 28 07:39:58 UTC 2023 - Matej Cepl
+
+- Split building and testing build
+
-------------------------------------------------------------------
Sat Mar 18 10:16:45 UTC 2023 - Johannes Kastl
diff --git a/python-mkdocs-material-extensions.spec b/python-mkdocs-material-extensions.spec
index 8dcbd38..5241041 100644
--- a/python-mkdocs-material-extensions.spec
+++ b/python-mkdocs-material-extensions.spec
@@ -1,5 +1,5 @@
#
-# spec file for package python-mkdocs-material-extensions
+# spec file
#
# Copyright (c) 2023 SUSE LLC
#
@@ -16,23 +16,33 @@
#
-Name: python-mkdocs-material-extensions
+%global flavor @BUILD_FLAVOR@%{nil}
+%if "%{flavor}" == "test"
+%define psuffix -test
+%bcond_without test
+%else
+%define psuffix %{nil}
+%bcond_with test
+%endif
+Name: python-mkdocs-material-extensions%{psuffix}
Version: 1.1.1
Release: 0
Summary: Extension pack for Python Markdown
License: MIT
URL: https://github.com/facelessuser/mkdocs-material-extensions
Source: https://files.pythonhosted.org/packages/source/m/mkdocs_material_extensions/mkdocs_material_extensions-%{version}.tar.gz
-BuildRequires: python-rpm-macros
BuildRequires: %{python_module hatch}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
+BuildRequires: python-rpm-macros
+%if %{with test}
# SECTION test requirements
BuildRequires: %{python_module beautifulsoup4}
-BuildRequires: %{python_module pytest}
BuildRequires: %{python_module Markdown}
BuildRequires: %{python_module mkdocs-material}
+BuildRequires: %{python_module pytest}
# /SECTION
+%endif
BuildRequires: fdupes
BuildArch: noarch
%python_subpackages
@@ -47,17 +57,23 @@ Extension pack for Python Markdown
%pyproject_wheel
%install
+%if %{without test}
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
+%endif
%check
+%if %{with test}
# skip TestEmoji.test_twemoji that needs internet access
%pytest -k 'not test_twemoji'
+%endif
+%if %{without test}
%files %{python_files}
%doc README.md changelog.md
%license LICENSE.md
%{python_sitelib}/materialx
%{python_sitelib}/mkdocs_material_extensions-%{version}.dist-info
+%endif
%changelog