Skip to content

Commit 4e42f7a

Browse files
authored
Addition of isInstance test of BackendSerial (#4773)
* Update test_base.py Addition of test for serial backend instance * Update test_base.py pep fix * Update test_base.py Adjusted test_instance_serial_backend to test through pytest raise ValueError
1 parent b254921 commit 4e42f7a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

testsuite/MDAnalysisTests/analysis/test_base.py

+13
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,19 @@ def test_parallelizable_transformations():
286286
with pytest.raises(ValueError):
287287
FrameAnalysis(u.trajectory).run(backend='multiprocessing')
288288

289+
290+
def test_instance_serial_backend(u):
291+
# test that isinstance is checked and the correct ValueError raise appears
292+
msg = 'Can not display progressbar with non-serial backend'
293+
with pytest.raises(ValueError, match=msg):
294+
FrameAnalysis(u.trajectory).run(
295+
backend=backends.BackendMultiprocessing(n_workers=2),
296+
verbose=True,
297+
progressbar_kwargs={"leave": True},
298+
unsupported_backend=True
299+
)
300+
301+
289302
def test_frame_bool_fail(client_FrameAnalysis):
290303
u = mda.Universe(TPR, XTC) # dt = 100
291304
an = FrameAnalysis(u.trajectory)

0 commit comments

Comments
 (0)