Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some of the test issues on windows #19

Merged
merged 5 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ include src/badger/gui/default/images/*.png
graft src/badger/tests
prune src/badger/tests/**/__pycache__
recursive-exclude src/badger/tests **/.DS_Store
graft src/badger/built_in_plugins
4 changes: 2 additions & 2 deletions src/badger/actions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pkg_resources import get_distribution
from importlib import metadata
from .doctor import check_n_config_paths
from ..utils import yprint
from ..log import set_log_level
Expand Down Expand Up @@ -36,7 +36,7 @@ def show_info(args):

info = {
'name': 'Badger the optimizer',
'version': get_distribution('badger-opt').version,
'version': metadata.version('badger-opt'),
'plugin root': BADGER_PLUGIN_ROOT,
'database root': BADGER_DB_ROOT,
'logbook root': BADGER_LOGBOOK_ROOT,
Expand Down
14 changes: 9 additions & 5 deletions src/badger/tests/test_cli_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,19 @@ def test_cli_main():
assert exitcode == 0

# Check output lines
outlines = out.split('\n')
assert len(outlines) == 7
outlines = out.splitlines()
assert len(outlines) == 6

# Check name
assert outlines[0] == 'name: Badger the optimizer'

# Check version
version = metadata.version('badger-opt')
assert outlines[1] == f'version: {version}'
try: # yaml encoding number-like string differently
_ = float(version)
assert outlines[1] == f"version: '{version}'"
except ValueError:
assert outlines[1] == f'version: {version}'


def test_list_algo():
Expand All @@ -36,7 +40,7 @@ def test_list_algo():
assert exitcode == 0

# Check output lines
outlines = out.split('\n')
outlines = out.splitlines()
assert '- upper_confidence_bound' in outlines


Expand All @@ -49,7 +53,7 @@ def test_list_algo():
# assert exitcode == 0

# # Check output lines
# outlines = out.split('\n')
# outlines = out.splitlines()
# assert len(outlines) == 15

# # Check table header
Expand Down
Loading