Test "is_extension" after a round trip to dict (#18188)

closes #3887
closes #3853
This commit is contained in:
Massimiliano Culpo 2020-08-20 17:08:49 +02:00 committed by GitHub
parent d5c3b876e0
commit 1addcff724
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -987,3 +987,19 @@ def test_error_message_unknown_variant(self):
s = Spec('mpileaks +unknown')
with pytest.raises(UnknownVariantError, match=r'package has no such'):
s.concretize()
@pytest.mark.regression('3887')
@pytest.mark.parametrize('spec_str', [
'git', 'hdf5', 'py-flake8'
])
def test_is_extension_after_round_trip_to_dict(config, spec_str):
# x is constructed directly from string, y from a
# round-trip to dict representation
x = Spec(spec_str)
x.concretize()
y = Spec.from_dict(x.to_dict())
# Using 'y' since the round-trip make us lose build dependencies
for d in y.traverse():
assert x[d.name].package.is_extension == y[d.name].package.is_extension