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

Don't remove extraneous configurations, only warn about their presence #218

Merged
merged 3 commits into from
Nov 6, 2017

Conversation

macisamuele
Copy link
Collaborator

@macisamuele macisamuele commented Nov 4, 2017

Fixes #217 .

The goal of this PR is to fix the current Yelp/bravado build failure.

bravado is failing because it used to inject also_return_response configuration into bravado-core configs, which is not using that config.

Since bravado-core is not using this config, I'm not adding it into CONFIG_DEFAULTS, but removing the logic that strips out extraneous configurations.

This PR exposes also _deref method in order to force dereferencing of objects even if internaly_dereference_ref in order to reduce test_deref_flattened_spec_not_recursive_specs flakyness.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.001%) to 98.03% when pulling 3e7b348 on macisamuele:maci-fix-217 into 4427867 on Yelp:master.

@@ -244,17 +243,15 @@ def _internal_spec_dict(self):
else:
return self.spec_dict

def deref(self, ref_dict):
def _deref(self, ref_dict):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, should we call this differently? E.g. _force_deref?

):
spec = Spec.from_dict(minimal_swagger_dict, origin_url=get_url(minimal_swagger_abspath), config=config)
assert spec.config != dict(CONFIG_DEFAULTS, **config)
assert bool(spec.config != dict(CONFIG_DEFAULTS, **config)) is expected_different_config
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs the brackets, but not the bool cast (the brackets are needed due to Python's comparison operator chaining).

@coveralls
Copy link

Coverage Status

Coverage increased (+0.001%) to 98.03% when pulling 8aa27cf on macisamuele:maci-fix-217 into 4427867 on Yelp:master.

@sjaensch sjaensch merged commit 10b6119 into Yelp:master Nov 6, 2017
@macisamuele macisamuele deleted the maci-fix-217 branch November 6, 2017 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'also_return_response' should be added to CONFIG_DEFAULTS
3 participants