Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit be841c4

Browse files
author
Jaquier Aurélien Tristan
committed
use bultin mock module
1 parent 2b80705 commit be841c4

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

bluepyopt/tests/test_deapext/test_algorithms.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""bluepyopt.optimisations tests"""
22

33
import numpy
4-
import mock
4+
from unittest import mock
55

66
import deap.creator
77
import deap.benchmarks
@@ -75,7 +75,7 @@ def test_eaAlphaMuPlusLambdaCheckpoint_with_checkpoint():
7575

7676
with mock.patch('pickle.dump'):
7777
with mock.patch('bluepyopt.deapext.algorithms.open',
78-
return_value=None):
78+
mock.mock_open()):
7979
population, hof, logbook, history = \
8080
bluepyopt.deapext.algorithms.eaAlphaMuPlusLambdaCheckpoint(
8181
population=population,
@@ -99,7 +99,7 @@ def test_eaAlphaMuPlusLambdaCheckpoint_with_checkpoint():
9999
'rndstate': random.getstate(),
100100
'generation': 1}):
101101
with mock.patch('bluepyopt.deapext.algorithms.open',
102-
return_value=None):
102+
mock.mock_open()):
103103
new_population, hof, logbook, history = \
104104
bluepyopt.deapext.algorithms.eaAlphaMuPlusLambdaCheckpoint(
105105
population=population,

bluepyopt/tests/test_ephys/test_simulators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import pytest
2828
import numpy
2929

30-
import mock
30+
from unittest import mock
3131
import numpy
3232

3333
import bluepyopt.ephys as ephys

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ extras = tests
1818
deps =
1919
coverage
2020
flake8
21-
mock
2221
neuron-nightly
2322
sh
2423
pytest-cov

0 commit comments

Comments
 (0)