Skip to content

Commit

Permalink
migrate from external mock package to stdlib unittest.mock (#212)
Browse files Browse the repository at this point in the history
The PyPI standalone mock package is a straight backport of the stdlib to
older versions of python. It is usually not needed.

In this case, the required version of mock is >=4, which backports the
python 3.8 stdlib. The minimum version of python required is already
3.8, so all functionality guaranteed to exist is already part of the
stdlib.

Simply use the stdlib directly.
  • Loading branch information
eli-schwartz authored Dec 4, 2023
1 parent 448d1a0 commit 6fe8c4e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ testpaths =
graphviz
tests
addopts =
--doctest-modules
--doctest-modules
--doctest-glob='*.rst' --ignore=docs/conf.py
--doctest-continue-on-failure
# pytest summary: all except (E)rror
Expand All @@ -24,7 +24,6 @@ addopts =
--durations=10
--cov --cov-report=term --cov-report=html
--strict-config --strict-markers
mock_use_standalone_module = true
log_cli = true
log_cli_level = WARNING
log_file = test-log.txt
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
extras_require={
'dev': ['tox>=3', 'flake8', 'pep8-naming', 'wheel', 'twine'],
'test': ['pytest>=7',
'pytest-mock>=3', 'mock>=4',
'pytest-mock>=3',
'pytest-cov', 'coverage'],
'docs': ['sphinx>=5,<7', 'sphinx-autodoc-typehints', 'sphinx-rtd-theme'],
},
Expand Down

0 comments on commit 6fe8c4e

Please sign in to comment.