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

PR: Fix Pytest catching up tests using Spyder-unittest or VSCode #20092

Merged
merged 3 commits into from
Nov 20, 2022

Conversation

maurerle
Copy link
Contributor

Description of Changes

When Debugging in an editor with pytest support (for example spyder with spyder-unittest plugin, PyCharm or VS Code) the tests were not catched up.

This was due to the fact that there was

  • an import error E ImportError: QtWebEngineWidgets must be imported or Qt.AA_ShareOpenGLContexts must be set before a QCoreApplication instance is created
  • pytest_plugins in external-deps Defining 'pytest_plugins' in a non-top-level conftest is no longer supported:

Both is fixed in this commit allowing to run a single Test file directly from the IDE or even debugging a single test directly.
Before that, one could only run a single test using pytest testfile.py instead of the whole suite

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct: Florian Maurer

@maurerle maurerle changed the title fix debug conf using spyder-unittest or VSC PR: Fix pytest catching up tests using spyder-unittest or VSC Nov 19, 2022
@ccordoba12 ccordoba12 changed the base branch from master to 5.x November 19, 2022 16:27
@ccordoba12 ccordoba12 added this to the v5.4.1 milestone Nov 19, 2022
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @maurerle for your help with this! I left a couple of small suggestions for you, otherwise looks good to me.

pytest.ini Outdated Show resolved Hide resolved
spyder/app/tests/conftest.py Outdated Show resolved Hide resolved
@ccordoba12 ccordoba12 changed the title PR: Fix pytest catching up tests using spyder-unittest or VSC PR: Fix Pytest catching up tests using Spyder-unittest or VSCode Nov 19, 2022
maurerle and others added 2 commits November 19, 2022 18:50
Co-authored-by: Carlos Cordoba <ccordoba12@gmail.com>
Co-authored-by: Carlos Cordoba <ccordoba12@gmail.com>
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @maurerle!

Note: In the future please add all suggestions to the batch, so they are pushed in a single commit. That's described here:

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/incorporating-feedback-in-your-pull-request

@ccordoba12 ccordoba12 merged commit c8dad06 into spyder-ide:5.x Nov 20, 2022
ccordoba12 added a commit that referenced this pull request Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants