diff --git a/matplotlib-setup.cfg b/matplotlib-setup.cfg
index da36eb4..485e447 100644
--- a/matplotlib-setup.cfg
+++ b/matplotlib-setup.cfg
@@ -1,98 +1,40 @@
-# Rename this file to setup.cfg to modify Matplotlib's
-# build options.
+# Rename this file to setup.cfg to modify Matplotlib's build options.
 
 [egg_info]
 
-[directories]
-# Uncomment to override the default basedir in setupext.py.
-# This can be a single directory or a comma-delimited list of directories.
-#basedirlist = /usr
-
-[test]
-# If you plan to develop Matplotlib and run or add to the test suite,
-# set this to True.  It will download and build a specific version of
-# FreeType, and then use that to build the ft2font extension.  This
-# ensures that test images are exactly reproducible.
-#local_freetype = False
-
-[status]
-# To suppress display of the dependencies and their versions
-# at the top of the build log, uncomment the following line:
-#suppress = True 
+[libs]
+# By default, Matplotlib builds with LTO, which may be slow if you re-compile
+# often, and don't need the space saving/speedup.
+#enable_lto = True
+# By default, Matplotlib downloads and builds its own copy of FreeType, and
+# builds its own copy of Qhull.  You may set the following to True to instead
+# link against a system FreeType/Qhull.
+#system_freetype = False
+#system_qhull = False
 
 [packages]
-# There are a number of subpackages of Matplotlib that are considered
-# optional. All except tests are installed by default, but that can
-# be changed here.
-#
+# There are a number of data subpackages from Matplotlib that are
+# considered optional. All except 'tests' data (meaning the baseline
+# image files) are installed by default, but that can be changed here.
 tests = True
 sample_data = True
-toolkits = True
-# Tests for the toolkits are only automatically installed
-# if the tests and toolkits packages are also getting installed.
-#toolkits_tests = auto
 
 [gui_support]
-# Matplotlib supports multiple GUI toolkits, including
-# GTK, MacOSX, Qt4, Qt5, Tk, and WX. Support for many of
-# these toolkits requires AGG, the Anti-Grain Geometry library,
-# which is provided by Matplotlib and built by default.
+# Matplotlib supports multiple GUI toolkits, known as backends.
+# The MacOSX backend requires the Cocoa headers included with XCode.
+# You can select whether to build it by uncommenting the following line.
+# It is never built on Linux or Windows, regardless of the config value.
 #
-# Some backends are written in pure Python, and others require
-# extension code to be compiled. By default, Matplotlib checks for
-# these GUI toolkits during installation and, if present, compiles the
-# required extensions to support the toolkit.
-#
-# - GTK 2.x support of any kind requires the GTK runtime environment
-#   headers and PyGTK.
-# - Tk support requires Tk development headers and Tkinter.
-# - Mac OSX backend requires the Cocoa headers included with XCode.
-# - Windowing is MS-Windows specific, and requires the "windows.h"
-#   header.
-#
-# The other GUI toolkits do not require any extension code, and can be
-# used as long as the libraries are installed on your system --
-# therefore they are installed unconditionally.
-#
-# You can uncomment any the following lines to change this
-# behavior. Acceptible values are:
-#
-#     True: build the extension. Exits with a warning if the
-#           required dependencies are not available
-#     False: do not build the extension
-#     auto: build if the required dependencies are available,
-#           otherwise skip silently. This is the default
-#           behavior
-#
-agg = True
-cairo = Auto
-gtk3agg = Auto
-gtk3cairo = Auto
-pyside = Auto
-qt4agg = Auto
-tkagg = Auto
-wxagg = Auto
-gtk = False
-gtkagg = False
-macosx = False
-windowing = False
+#macosx = True
 
 [rc_options]
 # User-configurable options
 #
-# Default backend, one of: Agg, Cairo, GTK, GTKAgg, GTKCairo,
-# GTK3Agg, GTK3Cairo, MacOSX, Pdf, Ps, Qt4Agg, Qt5Agg, SVG, TkAgg, WX, WXAgg.
+# Default backend, one of: Agg, Cairo, GTK3Agg, GTK3Cairo, MacOSX, Pdf, Ps,
+# Qt4Agg, Qt5Agg, SVG, TkAgg, WX, WXAgg.
 #
-# The Agg, Ps, Pdf and SVG backends do not require external
-# dependencies. Do not choose GTK, GTKAgg, GTKCairo, MacOSX, or TkAgg
-# if you have disabled the relevent extension modules.  Agg will be used
-# by default.
+# The Agg, Ps, Pdf and SVG backends do not require external dependencies.  Do
+# not choose MacOSX if you have disabled the relevant extension modules.  The
+# default is determined by fallback.
 #
-backend = Agg
-#
-
-[package_data]
-# Package additional files found in the lib/matplotlib directories.
-#
-# On Windows, package DLL files.
-#dlls = True
+#backend = Agg
diff --git a/python-matplotlib.changes b/python-matplotlib.changes
index e1fccb9..9db6391 100644
--- a/python-matplotlib.changes
+++ b/python-matplotlib.changes
@@ -1,3 +1,22 @@
+-------------------------------------------------------------------
+Mon Jul 20 21:10:29 UTC 2020 - Benjamin Greiner <code@bnavigator.de>
+
+- Work on unit testing
+  * Move architecture selection to bcond definition at top of 
+    specfile. This makes it clear in the OBS web UI that the test
+    flavor is only built for x86_64 and aarch64
+  * do not build everything a second time during check (in-place)
+  * instead use new subpackage testdata wich contains the baseline
+    images created at regular build time
+  * use pytest-xvfb and %pytest macro 
+    (buildroot path actually not required)
+  * tidy test skip definitions
+  * add python-gobject-Gdk to pass the gtk3 backend testso
+- include version for obsoletes -qt-shared (rpmlint warning)
+- move some cairo files to backend packages
+- remove python2 transition requirements mock and six
+- update matplotlib-setup.cfg
+
 -------------------------------------------------------------------
 Sat Jul 18 19:20:56 UTC 2020 - Todd R <toddrme2178@gmail.com>
 
diff --git a/python-matplotlib.spec b/python-matplotlib.spec
index a00ae4d..d9f54dc 100644
--- a/python-matplotlib.spec
+++ b/python-matplotlib.spec
@@ -24,6 +24,8 @@
 %if "%{flavor}" == "test"
 %define psuffix -test
 %bcond_without test
+# Run on 64bit intel and arm only, on others there are >100 test failures
+ExclusiveArch:  x86_64 aarch64
 %else
 %define psuffix %{nil}
 %bcond_with test
@@ -47,7 +49,6 @@ BuildRequires:  %{python_module numpy-devel >= 1.7.1}
 BuildRequires:  %{python_module pyparsing > 2.1.6}
 BuildRequires:  %{python_module pytz}
 BuildRequires:  %{python_module setuptools}
-BuildRequires:  %{python_module six >= 1.10}
 BuildRequires:  c++_compiler
 BuildRequires:  fdupes
 BuildRequires:  pkgconfig
@@ -59,7 +60,6 @@ Requires:       python-numpy >= 1.7.1
 Requires:       python-pyparsing > 2.1.6
 Requires:       python-python-dateutil >= 2.1
 Requires:       python-pytz
-Requires:       python-six >= 1.10
 Recommends:     ghostscript
 Recommends:     libxml2-tools
 Recommends:     poppler-tools
@@ -77,18 +77,25 @@ BuildRequires:  pkgconfig(tcl)
 # /SECTION
 %if %{with test}
 BuildRequires:  %{python_module Pillow}
-BuildRequires:  %{python_module mock}
+BuildRequires:  %{python_module matplotlib-cairo = %{version}}
+BuildRequires:  %{python_module matplotlib-gtk3 = %{version}}
+BuildRequires:  %{python_module matplotlib-qt5 = %{version}}
+BuildRequires:  %{python_module matplotlib-testdata = %{version}}
+BuildRequires:  %{python_module matplotlib-tk = %{version}}
+BuildRequires:  %{python_module matplotlib-web = %{version}}
+BuildRequires:  %{python_module matplotlib-wx = %{version}}
 BuildRequires:  %{python_module pytest-xdist}
+BuildRequires:  %{python_module pytest-xvfb}
 BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module python-dateutil >= 2.1}
 # SECTION cairo dependencies
 BuildRequires:  %{python_module cairo}
+# /SECTION
 # SECTION GTK3 dependencies
-BuildRequires:  %{python_module gobject}
+BuildRequires:  %{python_module gobject-Gdk}
 # /SECTION
 # SECTION Qt5 dependencies
 BuildRequires:  %{python_module qt5}
-BuildRequires:  xvfb-run
 BuildRequires:  pkgconfig(gtk+-3.0)
 # /SECTION
 # SECTION tk dependencies
@@ -139,7 +146,7 @@ Summary:        GTK3 backends for %{name}
 License:        BSD-2-Clause
 Requires:       %{name} = %{version}
 Requires:       %{name}-cairo = %{version}
-Requires:       python-gobject
+Requires:       python-gobject-Gdk
 
 %description    gtk3
 This package includes the GTK3-based gtk3, gtk3agg, and
@@ -164,12 +171,21 @@ License:        BSD-2-Clause
 Requires:       %{name} = %{version}
 Requires:       python-qt5
 Provides:       %{name}-qt-shared = %{version}
-Obsoletes:      %{name}-qt-shared
+Obsoletes:      %{name}-qt-shared < %{version}
 
 %description    qt5
 This package includes the Qt5-based pyqt5 backend
 for the %{name} plotting package
 
+%package        testdata
+Summary:        Test data for %{name}
+License:        BSD-2-Clause
+Requires:       %{name} = %{version}
+
+%description    testdata
+This package includes the test baseline data
+for the %{name} plotting package
+
 %package        tk
 Summary:        Tk backend for %{name}
 License:        BSD-2-Clause
@@ -207,51 +223,39 @@ chmod -x lib/matplotlib/mpl-data/images/*.svg
 find examples lib/matplotlib lib/mpl_toolkits/mplot3d -type f -name "*.py" -exec sed -i "s|#!\/usr\/bin\/env python||" {} \;
 find examples lib/matplotlib lib/mpl_toolkits/mplot3d -type f -name "*.py" -exec sed -i "s|#!\/usr\/bin\/python||" {} \;
 cp %{SOURCE1} setup.cfg
-
 %patch0 -p1
 
-%if !%{with test}
-sed -i -e 's/tests = .*/tests = False/' setup.cfg
-%else
-# As freetype changes the behaviour slightly for tests always use the bundled freetype
-sed -i -e 's:#local_freetype = False:local_freetype = True:' setup.cfg
-%endif
-
 %build
 %if !%{with test}
-export XDG_RUNTIME_DIR=/tmp
 %python_build
 %endif
 
 %install
 %if !%{with test}
-export XDG_RUNTIME_DIR=/tmp
 %python_install
 %{python_expand %fdupes %{buildroot}%{$python_sitearch}
 $python -m compileall -d %{$python_sitearch} %{buildroot}%{$python_sitearch}/matplotlib/backends/qt_editor/
 $python -O -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitearch}/matplotlib/backends/qt_editor/
 %fdupes %{buildroot}%{$python_sitearch}/matplotlib/backends/qt_editor/
+sed -i -e "s/install matplotlib from source/install the ${python_flavor}-matplotlib-testdata package/" \
+    %{buildroot}%{$python_sitearch}/matplotlib/tests/__init__.py
 }
 %endif
 
 %if %{with test}
 %check
-# test_savefig_to_stringio - generated ps is differing a bit
-# test_interactive_backend - needs full X session
-# test_bbox_inches_tight_raster - resulting PNGs look differently
-# test_backend_fallback_headful - fails to detect X session with xvfb
-# test_usetex - png differs
-# test_pdflatex - output slightly differs
-# test_labels test_collection - fails on aarch64
-# test_fig_signals - races and fails randomly
-# test_otf - fails with tex 2020
-# Run on 64bit intel and arm only, on others there are >100 test failures
-%ifarch x86_64 aarch64
-export XDG_RUNTIME_DIR=/tmp
-export PYTHONDONTWRITEBYTECODE=1
-%python_exec setup.py build_ext --inplace
-%python_expand PYTHONPATH=./lib xvfb-run $python -m pytest -v -n auto -k 'not (test_savefig_to_stringio or test_interactive_backend or test_bbox_inches_tight_raster or test_backend_fallback_headful or test_usetex or test_pdflatex or test_labels or test_collection or test_otf or test_fig_signals)'
-%endif
+# fails to detect alternative backend within xvfb
+skip_tests+=" or test_backend_fallback_headful"
+# test_usetex.py::test_usetex[png] - no tex text -- do not skip test_empty[png] and test_unicode_minus[png]
+skip_tests+=" or (test_usetex and png and not empty and not unicode)"
+# output slightly differs: text moves a bit
+skip_tests+=" or test_pdflatex"
+# we do not ship the qt4 backend
+skip_tests+=" or (test_correct_key and Qt4Agg)"
+skip_tests+=" or (test_fig_close and Qt4Agg)"
+# timing tests on obs can fail unpredictably
+skip_tests+=" or test_invisible_Line_rendering"
+%pytest_arch --pyargs matplotlib.tests --pyargs mpl_toolkits.tests -n auto -k "not ( ${skip_tests:4} )"
 %endif
 
 %if !%{with test}
@@ -272,34 +276,41 @@ export PYTHONDONTWRITEBYTECODE=1
 %exclude %{python_sitearch}/matplotlib/backends/backend_gtk3cairo.*
 %exclude %{python_sitearch}/matplotlib/backends/backend_qt4.py*
 %exclude %{python_sitearch}/matplotlib/backends/backend_qt4agg.py*
+%exclude %{python_sitearch}/matplotlib/backends/backend_qt4cairo.py*
 %exclude %{python_sitearch}/matplotlib/backends/backend_qt5.*
 %exclude %{python_sitearch}/matplotlib/backends/backend_qt5agg.*
+%exclude %{python_sitearch}/matplotlib/backends/backend_qt5cairo.py*
 %exclude %{python_sitearch}/matplotlib/backends/backend_tkagg.*
+%exclude %{python_sitearch}/matplotlib/backends/backend_tkcairo.*
 %exclude %{python_sitearch}/matplotlib/backends/backend_webagg.*
 %exclude %{python_sitearch}/matplotlib/backends/backend_webagg_core.*
 %exclude %{python_sitearch}/matplotlib/backends/backend_wx.*
 %exclude %{python_sitearch}/matplotlib/backends/backend_wxagg.*
+%exclude %{python_sitearch}/matplotlib/backends/backend_wxcairo.*
 %exclude %{python_sitearch}/matplotlib/backends/qt_compat.*
 %exclude %{python_sitearch}/matplotlib/backends/qt_editor/
-%exclude %{python_sitearch}/matplotlib/backends/tkagg.*
 %exclude %{python_sitearch}/matplotlib/backends/web_backend/
-%exclude %{python_sitearch}/matplotlib/backends/wx_compat.*
 %exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_cairo.*.py*
 %exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_gtk3.*.py*
 %exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_gtk3agg.*.py*
 %exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_gtk3cairo.*.py*
 %exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt4.*.py*
 %exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt4agg.*.py*
+%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt4cairo.*.py*
 %exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt5.*.py*
 %exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt5agg.*.py*
+%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt5cairo.*.py*
 %exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_tkagg.*.py*
+%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_tkcairo.*.py*
 %exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_webagg.*.py*
 %exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_webagg_core.*.py*
 %exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_wx.*.py*
 %exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_wxagg.*.py*
+%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_wxcairo.*.py*
 %exclude %{python_sitearch}/matplotlib/backends/__pycache__/qt_compat.*.py*
-%exclude %{python_sitearch}/matplotlib/backends/__pycache__/tkagg.*.py*
-%exclude %{python_sitearch}/matplotlib/backends/__pycache__/wx_compat.*.py*
+%exclude %{python_sitearch}/matplotlib/tests/baseline_images
+%exclude %{python_sitearch}/matplotlib/tests/tinypages
+%exclude %{python_sitearch}/mpl_toolkits/tests/baseline_images
 
 # Dummy package to pull in latex dependencies.
 %files %{python_files latex}
@@ -327,17 +338,30 @@ export PYTHONDONTWRITEBYTECODE=1
 %license doc/users/license.rst
 %{python_sitearch}/matplotlib/backends/backend_qt5.py*
 %{python_sitearch}/matplotlib/backends/backend_qt5agg.py*
+%{python_sitearch}/matplotlib/backends/backend_qt5cairo.py*
 %{python_sitearch}/matplotlib/backends/qt_compat.py*
 %{python_sitearch}/matplotlib/backends/qt_editor/
 %pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt5.*.py*
 %pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt5agg.*.py*
+%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt5cairo.*.py*
 %pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/qt_compat.*.py*
 
+%files %{python_files testdata}
+%license LICENSE/
+%license doc/users/license.rst
+%{python_sitearch}/matplotlib/tests/baseline_images
+%{python_sitearch}/matplotlib/tests/tinypages
+%{python_sitearch}/mpl_toolkits/tests/baseline_images
+%exclude %{python_sitearch}/matplotlib/tests/tinypages/.gitignore
+%exclude %{python_sitearch}/matplotlib/tests/tinypages/_static/.gitignore
+
 %files %{python_files tk}
 %license LICENSE/
 %license doc/users/license.rst
 %{python_sitearch}/matplotlib/backends/backend_tkagg.py*
+%{python_sitearch}/matplotlib/backends/backend_tkcairo.py*
 %pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_tkagg.*.py*
+%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_tkcairo.*.py*
 
 %files %{python_files web}
 %license LICENSE/
@@ -345,6 +369,7 @@ export PYTHONDONTWRITEBYTECODE=1
 %{python_sitearch}/matplotlib/backends/backend_webagg.py*
 %{python_sitearch}/matplotlib/backends/backend_webagg_core.py*
 %{python_sitearch}/matplotlib/backends/web_backend/
+%exclude %{python_sitearch}/matplotlib/backends/web_backend/.*
 %pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_webagg.*.py*
 %pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_webagg_core.*.py*
 
@@ -353,8 +378,10 @@ export PYTHONDONTWRITEBYTECODE=1
 %license doc/users/license.rst
 %{python_sitearch}/matplotlib/backends/backend_wx.py*
 %{python_sitearch}/matplotlib/backends/backend_wxagg.py*
+%{python_sitearch}/matplotlib/backends/backend_wxcairo.py*
 %pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_wx.*.py*
 %pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_wxagg.*.py*
+%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_wxcairo.*.py*
 %endif
 
 %changelog