- 13 3月, 2018 3 次提交
-
-
由 Cleber Rosa 提交于
Under Python 3, as in Python 2, most objects are automatically hashable. Example: >>> class Foo(object): >>> pass >>> hash(Foo()) >>> 8760583602380 But if an object that implements __eq__ also has to implement __hash__. Under Python 3: >>> class Foo(object): >>> def __eq__(self, other): >>> return False Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unhashable type: 'Foo' Since TreeNode implements __eq__, under Python 3, it *must* implement __hash__. There are a few tricky points, though. One of them is that "The only required property is that objects which compare equal have the same hash value". TreeNodes have a very flexible equality comparison, which cannot be taken into account in a hash implementation which doesn't have access to the "other" object. To the best of my knowledge, the way to go with the TreeNode __hash__ implementation is to take into account the comparison of all attributes that are used on __eq__ (name, values, children) and use those as the composition for __hash__, as suggested by the Python docs. Unfortunately, some of the content of "values" and "children" may themselves be unshashable values (such as dicts coming from YAML test suite loader). My coward's way out here was to use a string representation of such unhashable types to compose the TreeNode hash. This fixes 5 unittests of the varianter_yaml_to_mux plugin when run under Python 3, such as: ====================================================================== ERROR: test_get_rel_path (tests.test_mux.TestAvocadoParams) ---------------------------------------------------------------------- .... if len(set([_[1] for _ in ret])) == 1: # single source of results TypeError: unhashable type: 'MuxTreeNode' Reference: https://docs.python.org/3/reference/datamodel.html#object.__hash__Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
In Python 3, the order of a dictionary items will be different than under Python 2. To not have to change the supporting code to return OrderedDicts, let's just simplify the comparison, breaking them down into each dictionary item. This fixes the varianter_yaml_to_mux plugin unittest failure under Python 3: ====================================================================== FAIL: test_fingerprint_order (tests.test_mux.TestMuxTree) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/cleber/src/avocado/avocado/optional_plugins/varianter_yaml_to_mux/tests/test_mux.py", line 231, in test_fingerprint_order self.assertEqual(str(variant1), "{'paths': '', 'variant': " AssertionError: "{'variant_id': 'child1-child2-9154', 'varia[65 chars] ''}" != "{'paths': '', 'variant': [TreeNode(name='ch[65 chars]54'}" - {'variant_id': 'child1-child2-9154', 'variant': [TreeNode(name='child1'), TreeNode(name='child2')], 'paths': ''} + {'paths': '', 'variant': [TreeNode(name='child1'), TreeNode(name='child2')], 'variant_id': 'child1-child2-9154'} Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
The items of a dictionary are not ordered by default, and between Python 2 and 3 they always come out different in my experience. Since this test is trying out the representation of a JSON built from dicts, the same applies. Let's make the checks a bit more flexible (and a bit less accurate to be honest) and check for the pieces of info inside the JSON file content. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
- 12 3月, 2018 2 次提交
-
-
由 Amador Pahim 提交于
Signed-off-by: NAmador Pahim <apahim@redhat.com>
-
由 Amador Pahim 提交于
Signed-off-by: NAmador Pahim <apahim@redhat.com>
-
- 09 3月, 2018 3 次提交
-
-
由 Cleber Rosa 提交于
Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Lukáš Doktor 提交于
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com> * https://github.com/avocado-framework/avocado: Remove deprecated multiplex options
-
- 08 3月, 2018 9 次提交
-
-
由 Cleber Rosa 提交于
The skip() method has been deprecated for quite some time. Let's remove it for good and have users using the decorators and cancel() instead. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
The '--filter-{only,out}' and '--multiplex' options have been deprecated in favor of '--mux-filter-{only,out}' and '--mux-yaml'. Let's remove them for good. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
To avoid breakage when newer versions come out, let's pin to current GitHub API version to v3. Reference: https://developer.github.com/v3/media/#request-specific-versionSigned-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Amador Pahim 提交于
There's a new DataSize object in avocado.utils.datastructures. Let's remove the redundant code and just use the DataSize object. Signed-off-by: NAmador Pahim <apahim@redhat.com>
-
由 Amador Pahim 提交于
Now that we have a second use case for it, let's finally create the DataSize object. Signed-off-by: NAmador Pahim <apahim@redhat.com>
-
由 Lukáš Doktor 提交于
Sometimes it's useful to be able to specify multiple references and not just a single one. When list is provided with this patch per-item discovery is performed. Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
-
由 Lukáš Doktor 提交于
Allowing name_prefix to be list allows one to specified shared parts of the name_prefix inherited from upper-node: !mux functional: !mux name_prefix: ["functional-"] rpm: name_prefix: ["rpm"] git: name_prefix: ["git"] which results in: "functional-rpm" and "functional-git". Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
-
由 Lukáš Doktor 提交于
The `extra_params` is a mutable object and can be modified by loader. This happens eg. in external_runner loader which removes the optional key. This patch uses `copy.deepcopy` to avoid such issues. Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
-
- 06 3月, 2018 1 次提交
-
-
由 Amador Pahim 提交于
Signed-off-by: NAmador Pahim <apahim@redhat.com>
-
- 01 3月, 2018 2 次提交
-
-
由 Cleber Rosa 提交于
Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
- 28 2月, 2018 3 次提交
-
-
由 Junxiang Li 提交于
To fix the pip 9.0.1 install python requirements with ">=2.7, >=3.4" failure, ">=2.7, >=3.4" means ">=2.7" and ">=3.4", so the result is ">=3.4" for reference: https://stackoverflow.com/questions/44660448/Signed-off-by: NJunxiang Li <junli@redhat.com>
-
由 Amador Pahim 提交于
Signed-off-by: NAmador Pahim <apahim@redhat.com>
-
由 Amador Pahim 提交于
Signed-off-by: NAmador Pahim <apahim@redhat.com>
-
- 27 2月, 2018 13 次提交
-
-
由 Cleber Rosa 提交于
We are, finally, advertising Python 3 support. Yes, it's supposed to be "beta" quality level, as there are a few leftover issues we know about, and possibly a whole lot more we don't. Still, we're taking that leap of faith, and that suggests describing that so that PyPI users and installation tools know about it. Reference: https://packaging.python.org/tutorials/distributing-packages/#classifiers Reference: https://packaging.python.org/tutorials/distributing-packages/#python-requiresSigned-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
The API used to get the file, by name, is `get_data()`, which looks for that file in one of the data directories that the class provides (file-level, class-level, variant-level, etc). Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
These parameters are not class instantiation parameters, which is the indentend usage of those docstring notations. But, even worse, they don't exist in these example tests at all. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
We don't do Python 2.6 anymore, so it's safe to drop this workaround. Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Cleber Rosa 提交于
Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Amador Pahim 提交于
The "test" fields was removed from JSON output as it was legacy/duplicated. This patch adapts the remote runner accordingly, using the key "id" instead. Signed-off-by: NAmador Pahim <apahim@redhat.com>
-
由 Amador Pahim 提交于
As part of the v59 release process. Signed-off-by: NAmador Pahim <apahim@redhat.com>
-
由 Amador Pahim 提交于
Now there's a new parameter executable to use as the commandline information. The previous parameter, name can now be hijacked by the yaml_loader, making this plugin to break. This patch adapts to that change of internal API. Signed-off-by: NAmador Pahim <apahim@redhat.com>
-
由 Amador Pahim 提交于
Now there's a new parameter `executable` to use as the command line information. The previous parameter, `name` can now be hijacked by the yaml_loader, making this plugin to break. This patch adapts to that change of internal API. Signed-off-by: NAmador Pahim <apahim@redhat.com>
-
由 Amador Pahim 提交于
Now there's a new parameter `executable` to use as the command line information. The previous parameter, `name` can now be hijacked by the yaml_loader, making this plugin to break. This patch adapts to that change of internal API. Signed-off-by: NAmador Pahim <apahim@redhat.com>
-
- 26 2月, 2018 4 次提交
-
-
由 Cleber Rosa 提交于
Signed-off-by: NCleber Rosa <crosa@redhat.com>
-
由 Amador Pahim 提交于
This check was introduced in the previous draft of this plugin, when it was using gtester, and left over. Dropping. Signed-off-by: NAmador Pahim <apahim@redhat.com>
-
由 Harish 提交于
As reported in the following link: https://github.com/avocado-framework/avocado/issues/2476 build.run_make fails to run when used without any argument. This patch handles the failure and runs make with ncpus if it is not specified in "env" Signed-off-by: NHarish <harish@linux.vnet.ibm.com>
-
由 Cleber Rosa 提交于
Signed-off-by: NCleber Rosa <crosa@redhat.com>
-