MCPcopy
hub / github.com/mne-tools/mne-python / test_strip_dev

Function test_strip_dev

mne/utils/tests/test_check.py:332–364  ·  view source on GitHub ↗

Test that stripping dev works.

(version, want, have_unstripped, monkeypatch)

Source from the content-addressed store, hash-verified

330 ],
331)
332def test_strip_dev(version, want, have_unstripped, monkeypatch):
333 """Test that stripping dev works."""
334 monkeypatch.setattr(
335 mne.utils.check, "import_module", lambda x: Bunch(__version__=version)
336 )
337 got_have_unstripped, same_version = check_version(
338 version, want, strip=False, return_version=True
339 )
340 assert same_version == version
341 assert got_have_unstripped is have_unstripped
342 have, simpler_version = check_version(
343 "foo", want, return_version=True
344 ) # strip=True is the default
345 assert have, (simpler_version, version)
346
347 def looks_stable(version):
348 try:
349 [int(x) for x in version.split(".")]
350 except ValueError:
351 return False
352 else:
353 return True
354
355 if looks_stable(version):
356 assert "dev" not in version
357 assert "rc" not in version
358 assert simpler_version == version
359 else:
360 assert simpler_version != version
361 assert "dev" not in simpler_version
362 assert "rc" not in simpler_version
363 assert not simpler_version.endswith(".")
364 assert looks_stable(simpler_version)
365
366
367@testing.requires_testing_data

Callers

nothing calls this directly

Calls 3

BunchClass · 0.90
check_versionFunction · 0.90
looks_stableFunction · 0.85

Tested by

no test coverage detected