Skip to content

Commit

Permalink
Use unittests.mock instead of third-party mock
Browse files Browse the repository at this point in the history
As long as it is available.  On EL7 we still use python2-mock.
  • Loading branch information
praiskup committed Jan 27, 2022
1 parent b486d0f commit 4860968
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rpm/distgen.spec.dg
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ BuildRequires: make
BuildRequires: %{pypkg}-devel
BuildRequires: %{pypkg}-distro
BuildRequires: %{pypkg}-jinja2
BuildRequires: %pypkg-mock
BuildRequires: %{meh_pypkg}pytest
%if 0%{?rhel} && 0%{?rhel} < 8
BuildRequires: %{pypkg}-mock
BuildRequires: %{pypkg}-pytest-catchlog
%endif
BuildRequires: %{meh_pypkg}PyYAML
Expand Down
8 changes: 5 additions & 3 deletions tests/unittests/test_distro_detection.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import os
import sys
import pytest
from mock import patch

try:
from unittest.mock import patch
except ImportError:
from mock import patch

from distgen.distro_version import detect_default_distro

Expand Down

0 comments on commit 4860968

Please sign in to comment.