Skip to content

Commit 63b12fb

Browse files
committed
MAINT: Lint things better
1 parent 6a2af5c commit 63b12fb

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

test/test_environment_bench.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import subprocess
22
import os
3-
import pytest
43
import json
4+
5+
import pytest
6+
57
from . import tools
68

79
ENVIRONMENTS = []

test/tools.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import subprocess
1717
import platform
1818
import http.server
19+
import importlib
1920
from os.path import abspath, join, dirname, relpath, isdir
2021
from contextlib import contextmanager
2122
from hashlib import sha256
@@ -95,10 +96,10 @@ def _check_conda():
9596
def _check_mamba():
9697
conda = _find_conda()
9798
try:
98-
# Attempt to import libmambapy to check if libmambapy is available
99-
import libmambapy
100-
subprocess.check_call([conda, 'build', '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
101-
# If both checks pass, return True indicating Mamba is available and conda-build is installed
99+
importlib.import_module('libmambapy')
100+
subprocess.check_call([conda, 'build', '--version'],
101+
stdout=subprocess.PIPE,
102+
stderr=subprocess.PIPE)
102103
return True
103104
except (ImportError, subprocess.CalledProcessError, FileNotFoundError):
104105
return False

0 commit comments

Comments
 (0)