Skip to content

Commit eeb4ab1

Browse files
committed
skip test if tqdm installed
1 parent 32fff5e commit eeb4ab1

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

tests/test_noise.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,10 +383,14 @@ def test_different_seeds(self, err_acc_scalar):
383383

384384

385385
class Test_allan_var_overlapping:
386-
def test_no_tqdm(self, monkeypatch):
387-
import sys
388386

389-
monkeypatch.delitem(sys.modules, "tqdm", raising=False)
387+
@staticmethod
388+
def _tqdm_installed():
389+
import importlib.util
390+
return importlib.util.find_spec("tqdm") is not None
391+
392+
@pytest.mark.skipif(_tqdm_installed(), reason="tqdm is installed")
393+
def test_no_tqdm(self):
390394
with pytest.raises(ImportError):
391395
y = np.random.random(1_000)
392396
tau, avar = allan_var(y, 10.0, progress=True)

0 commit comments

Comments
 (0)