Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several tests fail locally under user environment with customized keyboard shortcuts due to relying on hardcoded keybindings #6064

Closed
CAM-Gerlach opened this issue Dec 27, 2017 · 1 comment

Comments

@CAM-Gerlach
Copy link
Member

Description of your problem

As discussed in PR #6044 , in a number of tests of the Spyder test suite, including the very first non-skipped test on Windows, keybindings (using Qt.Key_XXX) are used to activate certain routines (pylint, run file, etc) which are hardcoded to the defaults (affects static_analysis, dedicated_console, and several skipped checks). This prevents me or anyone with custom shortcuts from running the tests at all past the first one, as that one (dedicated_console) fals due to this issue (due to the -x option in runtests.py), at least without one of a few tedious and time consuming workarounds every time. Personally, I'm not a huge fan of many of the default shortcuts and use a heavily customized scheme harmonized between several different IDEs, editors and machines, so just using the stock ones all the time isn't really an efficient option.

Possible solutions would be to either call the routines directly without going through the keybindings, read the actual keybindings from the config file and use those, or (probably best for the general case, as it could solve/prevent other possible test failures due to a non-default config) have the tests run themselves with a clean config file, e.g. temporarily write and restore it, or otherwise telling the tested copy of Spyder to use a clean config. Longer term, probably project-based or at least overridable config files are the answer, but as of now this is preventing anyone with non default shortcuts from running the tests without backing up, wiping and restoring their config files every time, so a straightforward and effective fix is ideal.

Therefore, as I am newer to this whole thing, I was hoping to get the rest of the team's feedback on what's the simplest and cleanest overall method to address this (either those mentioned above or something better I hadn't immediately thought of), and how to approach/structure it. Thanks!

What steps will reproduce the problem?

  1. Set a relevant shortcut (run file, run pylint, etc) to something other than the default
  2. Run the test suite (e.g. with python runtests.py)
  3. Observe failure

What is the expected output? What do you see instead?
Expected: Tests do not depend on user shortcut configuration. Actual: Tests do, and fail if changed.

@CAM-Gerlach CAM-Gerlach changed the title Several tests fail locally on with non-default keyboard shortcuts due to hardcoded keybindings Several tests fail locally, preventing the test suite from running, with non-default keyboard shortcuts due to hardcoded keybindings Dec 27, 2017
@CAM-Gerlach CAM-Gerlach changed the title Several tests fail locally, preventing the test suite from running, with non-default keyboard shortcuts due to hardcoded keybindings Several tests fail locally under user environment with customized keyboard shortcuts due to relying on hardcoded keybindings Dec 27, 2017
@ccordoba12 ccordoba12 added this to the v3.2.6 milestone Dec 28, 2017
@ccordoba12 ccordoba12 modified the milestones: v3.2.6, v3.2.7 Dec 29, 2017
@CAM-Gerlach CAM-Gerlach self-assigned this Jan 6, 2018
@ccordoba12 ccordoba12 modified the milestones: v3.2.7, v3.2.8 Jan 8, 2018
@ccordoba12 ccordoba12 modified the milestones: v3.2.8, v3.2.7 Jan 21, 2018
@CAM-Gerlach
Copy link
Member Author

Thanks @ccordoba12 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants