From a5036cf09422441b4f5f99a063a932e928c09896 Mon Sep 17 00:00:00 2001 From: Robert Bikar Date: Thu, 11 Mar 2021 13:05:42 +0100 Subject: [PATCH 1/2] Move to newer dist of ubuntu for travis CI Due to problems with rust compiler, let's move to newer dist of ubuntu on travis CI. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 5f9c4d85..f3a40013 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ +dist: bionic sudo: false language: python install: pip install tox From 1cfe5170a658fa391bd1099a341f4fddcdcfa74e Mon Sep 17 00:00:00 2001 From: Robert Bikar Date: Thu, 11 Mar 2021 13:40:06 +0100 Subject: [PATCH 2/2] Fix formatting and add installation of rpm package for travis --- .travis.yml | 3 +++ pubtools/pulplib/_impl/model/common.py | 3 +-- tests/model/assertions.py | 10 +++++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index f3a40013..2dab8d73 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,9 @@ dist: bionic sudo: false language: python +before_install: + # for rpm-py-installer + - sudo apt-get install -y rpm install: pip install tox matrix: include: diff --git a/pubtools/pulplib/_impl/model/common.py b/pubtools/pulplib/_impl/model/common.py index 03406a70..c0ccfee8 100644 --- a/pubtools/pulplib/_impl/model/common.py +++ b/pubtools/pulplib/_impl/model/common.py @@ -20,8 +20,7 @@ class DetachedException(Exception): class InvalidDataException(Exception): - """Raised if raw Pulp data appears to be invalid (i.e. not matching expected schema). - """ + """Raised if raw Pulp data appears to be invalid (i.e. not matching expected schema).""" class PulpObject(object): diff --git a/tests/model/assertions.py b/tests/model/assertions.py index 63db1e44..c969f9dd 100644 --- a/tests/model/assertions.py +++ b/tests/model/assertions.py @@ -46,9 +46,13 @@ def assert_model_fields(model_object): if value is not None: # These tests only valid on non-None value. - assert isinstance(value, field.type), ( - "%s.%s should be a %s but is not: %s" - % (klass.__name__, field.name, field.type.__name__, model_object) + assert isinstance( + value, field.type + ), "%s.%s should be a %s but is not: %s" % ( + klass.__name__, + field.name, + field.type.__name__, + model_object, ) if field.type is list: