10000 Fixes rebase conflict and unit tests · AIRob/python-for-android@bec18e1 · GitHub
[go: up one dir, main page]

Skip to content

Commit bec18e1

Browse files
committed
Fixes rebase conflict and unit tests
1 parent 4ed9dff commit bec18e1

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

pythonforandroid/distribution.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import glob
33
import json
44

5-
from pythonforandroid.logger import (info, info_notify, Err_Style, Err_Fore)
5+
from pythonforandroid.logger import (info, info_notify, warning, Err_Style, Err_Fore)
66
from pythonforandroid.util import current_directory, BuildInterruptingException
77
from shutil import rmtree
88

@@ -130,21 +130,7 @@ def get_distribution(cls, ctx, name=None, recipes=[],
130130
# If there was a name match but we didn't already choose it,
131131
# then the existing dist is incompatible with the requested
132132
# configuration and the build cannot continue
133-
<<<<<<< HEAD
134133
if name_match_dist is not None and not allow_replace_dist:
135-
error('Asked for dist with name {name} with recipes ({req_recipes}) and '
136-
'NDK API {req_ndk_api}, but a dist '
137-
'with this name already exists and has either incompatible recipes '
138-
'({dist_recipes}) or NDK API {dist_ndk_api}'.format(
139-
name=name,
140-
req_ndk_api=ndk_api,
141-
dist_ndk_api=name_match_dist.ndk_api,
142-
req_recipes=', '.join(recipes),
143-
dist_recipes=', '.join(name_match_dist.recipes)))
144-
error('No compatible dist found, so exiting.')
145-
exit(1)
146-
=======
147-
if name_match_dist is not None:
148134
raise BuildInterruptingException(
149135
'Asked for dist with name {name} with recipes ({req_recipes}) and '
150136
'NDK API {req_ndk_api}, but a dist '
@@ -155,7 +141,6 @@ def get_distribution(cls, ctx, name=None, recipes=[],
155141
dist_ndk_api=name_match_dist.ndk_api,
156142
req_recipes=', '.join(recipes),
157143
dist_recipes=', '.join(name_match_dist.recipes)))
158-
>>>>>>> Replaced many exit(1)s with exceptions
159144

160145
# If we got this far, we need to build a new dist
161146
dist = Distribution(ctx)

tests/test_graph.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from pythonforandroid.build import Context
22
from pythonforandroid.graph import get_recipe_order_and_bootstrap
33
from pythonforandroid.bootstrap import Bootstrap
4+
from pythonforandroid.util import BuildInterruptingException
45
from itertools import product
56

67
import pytest
@@ -27,8 +28,12 @@ def test_valid_recipe_order_and_bootstrap(names, bootstrap):
2728

2829
@pytest.mark.parametrize('names,bootstrap', invalid_combinations)
2930
def test_invalid_recipe_order_and_bootstrap(names, bootstrap):
30-
with pytest.raises(SystemExit):
31+
with pytest.raises(BuildInterruptingException) as e_info:
3132
get_recipe_order_and_bootstrap(ctx, names, bootstrap)
33+
assert e_info.value.message == (
34+
"Didn't find any valid dependency graphs. "
35+
"This means that some of your requirements pull in conflicting dependencies."
36+
)
3237

3338

3439
def test_bootstrap_dependency_addition():

0 commit comments

Comments
 (0)
0