diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2018-11-21 11:17:28 +0100 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2018-11-21 11:34:32 +0100 |
| commit | 01757e5ac9324948ca64a4cf512352b09956a8fa (patch) | |
| tree | 26e920623f109b4cc761e574e67ddc5b67ba3b37 /testsuite.py | |
| parent | c8b867407862db914f9a4990c8c59f1a5d300106 (diff) | |
Disable test dependent on dict ordering on Python 3.5 and earlier
The KCONFIG_WARN_UNDEF test often fails on Python 3.4 (3.5 not tested),
but the output is still correct. It just differs due to dict ordering
randomness.
Python 3.6 iterates over dicts in insertion order in practice, and
Python 3.7 made it part of the spec, so enable the test for 3.6 and
later.
Python 2.7 seems fine as well.
Diffstat (limited to 'testsuite.py')
| -rw-r--r-- | testsuite.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/testsuite.py b/testsuite.py index 65ce4aa..22e12cc 100644 --- a/testsuite.py +++ b/testsuite.py @@ -2537,13 +2537,16 @@ config PRINT_ME_TOO sys.path.pop(0) + # This test can fail on older Python 3.x versions, because they don't + # preserve dict insertion order during iteration. The output is still + # correct, just different. + if not (3, 0) <= sys.version_info <= (3, 5): + print("Testing KCONFIG_WARN_UNDEF") - print("Testing KCONFIG_WARN_UNDEF") + os.environ["KCONFIG_WARN_UNDEF"] = "y" + c = Kconfig("Kconfiglib/tests/Kundef", warn_to_stderr=False) - os.environ["KCONFIG_WARN_UNDEF"] = "y" - c = Kconfig("Kconfiglib/tests/Kundef", warn_to_stderr=False) - - verify_equal("\n".join(c.warnings), """ + verify_equal("\n".join(c.warnings), """ warning: the int symbol INT (defined at Kconfiglib/tests/Kundef:8) has a non-int range [UNDEF_2 (undefined), 8 (undefined)] warning: undefined symbol UNDEF_1: @@ -2584,7 +2587,7 @@ menu "menu" visible if UNDEF_3 """[1:-1]) - os.environ.pop("KCONFIG_WARN_UNDEF") + os.environ.pop("KCONFIG_WARN_UNDEF") print("\nAll selftests passed\n" if all_passed else |
