forked from markovmodel/PyEMMA
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'devel' into fix_dt_model
- Loading branch information
Showing
16 changed files
with
634 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,15 @@ | ||
import pytest | ||
import sys | ||
|
||
# this is import for measuring coverage | ||
assert 'pyemma' not in sys.modules | ||
|
||
|
||
@pytest.fixture(scope='session') | ||
def no_progress_bars(): | ||
""" disables progress bars during testing """ | ||
import subprocess | ||
|
||
def pg_enabled(): | ||
out = subprocess.check_output(['python', '-c', 'from __future__ import print_function; import pyemma; print(pyemma.config.show_progress_bars)']) | ||
return out.find('True') != -1 | ||
|
||
def cache_enabled(): | ||
out = subprocess.check_output(['python', '-c', 'from __future__ import print_function; import pyemma; print(pyemma.config.use_trajectory_lengths_cache)']) | ||
return out.find('True') != -1 | ||
|
||
cfg_script = "import pyemma; pyemma.config.show_progress_bars = {pg}; pyemma.config.use_trajectory_lengths_cache = {cache};pyemma.config.save()" | ||
|
||
pg_old_state = pg_enabled() | ||
cache_old_state = cache_enabled() | ||
|
||
enable = cfg_script.format(pg=pg_old_state, cache=cache_old_state) | ||
disable = cfg_script.format(pg=False, cache=False) | ||
|
||
subprocess.call(['python', '-c', disable]) | ||
yield # run session, after generator returned, session is cleaned up. | ||
subprocess.call(['python', '-c', enable]) | ||
if 'pyemma' in sys.modules: | ||
pyemma = sys.modules['pyemma'] | ||
pyemma.config.show_progress_bars = False | ||
pyemma.config.use_trajectory_lengths_cache = False | ||
yield |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.