question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parametrization order changes between py2.7 and py3

See original GitHub issue

I am observing different parametrization order on the same test repository and command syntax between py2.7 and py3.6.6

The source repository where this is observed is ManageIQ/integration tests, and involves a tree of fixtures and parametrization. I’ll attempt to create a ‘unit’ level recreation to simplify, but wanted to report ASAP. I’ve discussed this a bit with @RonnyPfannschmidt and he is familiar with integration_tests and its environment.

In python 2.7, I observe the following test function name and param ids with the linked test/fixture: test_migration_long_name[virtualcenter-6.0-rhevm-4.2]

In python 3.6.6, the two parameters have switched: test_migration_long_name[rhevm-4.2-virtualcenter-6.0]

Fixture with first two parameters: https://github.com/ManageIQ/integration_tests/blob/master/cfme/fixtures/v2v.py#L38

Test module with provider and second_provider parametrized: https://github.com/ManageIQ/integration_tests/blob/master/cfme/tests/v2v/test_v2v_migrations.py#L19

Example test function above from same module, line 651: https://github.com/ManageIQ/integration_tests/blob/master/cfme/tests/v2v/test_v2v_migrations.py#L651

OS: Fedora 27 Both py.test runs are done in a virtualenv with frozen pip. pytest version 3.4.1 Frozen requirements for py2.7 and py3.6.6 environments: py2 requirements py3 requirements

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
nicoddemuscommented, Feb 18, 2019

Hi @mshriver,

Sorry for the silence on this, I must have forgotten to come back to this after applying the labels.

If you can produce a reproducible example, it would be great. It seems like a bug, we should be creating the same parametrization on py 2 and py3.

Can I get a sense from you guys what your plan is when dealing with issues like this?

Sure, we have written it down here. Let me know if there are any questions.

0reactions
asottilecommented, Jun 2, 2020

hello, first off thank you for the issue!

python 2.x support has ended for pytest core.

we’ve decided in #7296 to close the python-2-specific issues to free up some space in our backlog. however, in accordance to our python 2.7 and 3.4 support community patches will still be accepted to the 4.6 series to fix bugs for python 2. (so if this issue is important to you and you have a patch to fix it, feel free to make a PR targeting the 4.6.x branch despite this ticket being closed).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parametrizing fixtures and test functions — pytest documentation
parametrize allows one to define multiple sets of arguments and fixtures at the test function or class. pytest_generate_tests allows one to define custom ......
Read more >
How to change order of parametrize stacking in pytest classes?
I have a test class that has one parametrized class and some tests inside of it, that each have their own parametrize method....
Read more >
parameterized - PyPI
Parameterized testing with any Python test framework.
Read more >
pytest Documentation - Read the Docs
Assert assert order == ["a", "b"]. Notice that this is the same example from above, but very little changed. The fixtures in pytest...
Read more >
1.9.0 (2020-06-24) — py 1.9.1.dev3+g2da2cae documentation
fix issue35 - define __gt__ ordering between a local path and strings ... to point to respective str/unicode (py2) and bytes/str (py3) types ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found