-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f758e3
commit cce35ce
Showing
4 changed files
with
57 additions
and
49 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import os | ||
import sys | ||
import shutil | ||
import warnings | ||
|
||
import pytest | ||
import re | ||
import glob | ||
|
||
import socket | ||
from mmpycorex import (download_and_install_mm, find_existing_mm_install, create_core_instance, | ||
terminate_core_instances, get_default_install_location) | ||
|
||
@pytest.fixture(scope="session") | ||
def install_mm(): | ||
if find_existing_mm_install(): | ||
print('Micro-Manager is already installed, skipping installation') | ||
yield find_existing_mm_install() | ||
else: | ||
# Download an install latest nightly build | ||
mm_install_dir = download_and_install_mm(destination='auto') | ||
|
||
#### Replace with newer versions of Java libraries #### | ||
# find pycro-manager/java path | ||
if os.path.isdir('java'): | ||
java_path = os.path.abspath('java') | ||
# in case cwd is '/pycromanager/test' | ||
elif os.path.isdir('../../java'): | ||
java_path = os.path.abspath('../../java') | ||
else: | ||
raise RuntimeError('Could not find pycro-manager/java path') | ||
|
||
yield mm_install_dir | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def launch_micromanager(install_mm): | ||
mm_install_dir = get_default_install_location() | ||
config_file = os.path.join(mm_install_dir, 'MMConfig_demo.cfg') | ||
create_core_instance(mm_install_dir, config_file, | ||
buffer_size_mb=1024, max_memory_mb=1024, # set these low for github actions | ||
python_backend=True, | ||
debug=False) | ||
yield | ||
terminate_core_instances() |
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