# Error while running tests

**URL:** <https://mne.discourse.group/t/error-while-running-tests/11708>\
**Category:** Support & Discussions\
**Created:** [February 24, 2026, 5:02am UTC](https://mne.discourse.group/t/error-while-running-tests/11708 "2026-02-24T05:02:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![1himan](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/1himan/32/4697_2.png) [@1himan](https://mne.discourse.group/u/1himan)\
**Post date:** [February 24, 2026, 5:02am UTC](https://mne.discourse.group/t/error-while-running-tests/11708/1 "2026-02-24T05:02:42Z")

</div>

I’m getting this error every time I run tests via this command:

```python
 pytest -m "not ultraslowtest" mne

```

The error:

```python
mne/forward/tests/test_make_forward.py .sssssssss.sss.s. [35%]
mne/gui/tests/test_coreg.py sssssssssssX Error of failed request: BadWindow (invalid Window parameter)
  Major opcode of failed request: 12 (X_ConfigureWindow)
  Resource id in failed request: 0x28760ac0
  Serial number of failed request: 7
  Current serial number in output stream: 8

```

Any way I can run the full test suite without bumping into this error. Also note that it stops exactly at 35%.

---

<div class="post-metadata">

**Author:** ![tsbinns](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/tsbinns/32/4543_2.png) [@tsbinns](https://mne.discourse.group/u/tsbinns)\
**Post date:** [February 24, 2026, 9:53am UTC](https://mne.discourse.group/t/error-while-running-tests/11708/2 "2026-02-24T09:53:48Z")

</div>

Searching the error code gives this `pyvistaqt` issue: [X Error of failed request: BadWindow (invalid Window parameter) · Issue #445 · pyvista/pyvistaqt · GitHub](https://github.com/pyvista/pyvistaqt/issues/445)  
Has a suggested fix you could try. CC @larsoner

Also, if you run the tests with the `-v` flag, the pytest output will be more verbose and you’ll see the name of the test that is failing.

---

<div class="post-metadata">

**Author:** ![larsoner](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/larsoner/32/3_2.png) [@larsoner](https://mne.discourse.group/u/larsoner)\
**Post date:** [February 24, 2026, 5:08pm UTC](https://mne.discourse.group/t/error-while-running-tests/11708/3 "2026-02-24T17:08:28Z")

</div>

You can run with `xvfb-run` or really we should try to figure out which test is failing (`-v` or `-vv` will help with this) and add an appropriate / better skip function for when a usable Xwindow is not available (my guess is that you don’t have the right 3D support perhaps)

---

<div class="post-metadata">

**Author:** ![1himan](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/1himan/32/4697_2.png) [@1himan](https://mne.discourse.group/u/1himan)\
**Post date:** [March 7, 2026, 8:20am UTC](https://mne.discourse.group/t/error-while-running-tests/11708/4 "2026-03-07T08:20:10Z")

</div>

hhhmmm, Nice, using `export QT_QPA_PLATFORM=xcb` helps. The thread link you gave had a fix(or workaround).

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [March 14, 2026, 8:20am UTC](https://mne.discourse.group/t/error-while-running-tests/11708/5 "2026-03-14T08:20:40Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
