Skip to content

Commit

Permalink
Update test_base.py
Browse files Browse the repository at this point in the history
Adjusted test_instance_serial_backend to test through pytest raise ValueError
  • Loading branch information
talagayev authored Nov 13, 2024
1 parent 8a54898 commit 7d0dc7a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions testsuite/MDAnalysisTests/analysis/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,16 +288,16 @@ def test_parallelizable_transformations():


def test_instance_serial_backend(u):
serial_backend = backends.BackendSerial(n_workers=1)

FrameAnalysis(u.trajectory).run(
backend=serial_backend,
verbose=True,
progressbar_kwargs={"leave": True},
unsupported_backend=True
)
# test that isinstance is checked and the correct ValueError raise appears
msg = 'Can not display progressbar with non-serial backend'
with pytest.raises(ValueError, match=msg):
FrameAnalysis(u.trajectory).run(
backend=backends.BackendMultiprocessing(n_workers=2),
verbose=True,
progressbar_kwargs={"leave": True},
unsupported_backend=True
)

assert isinstance(serial_backend, backends.BackendSerial)

def test_frame_bool_fail(client_FrameAnalysis):
u = mda.Universe(TPR, XTC) # dt = 100
Expand Down

0 comments on commit 7d0dc7a

Please sign in to comment.