Spyder: test_mainwindow incorrectly picks up pytest arguments

Created on 19 Mar 2020  路  4Comments  路  Source: spyder-ide/spyder

While preparing the next spyder3 package for OpenSUSE Tumbleweed, v4.1.1, I run into the following unittest fail, which has not happened before:

test_mainwindow.py incorrectly checks the command line parameters for pytest as spyder parameters and fails with "invalid parameter"

OpenSUSE TW currently is upgrading a lot of packages while transitioning into Python3.8, so this might not be directly related to the spyder code. Any hints appreciated.

...
[  105s] + py.test-3.8 --ignore=_build.python2 --ignore=_build.python3 --ignore=_build.pypy3 -v -k 'not (test_github_backend or test_update or test_introspection or test_arrayeditor_edit_complex_array or test_mpl_backend_change or test_connection_dialog_remembers_input_with_ssh_passphrase or test_connection_dialog_remembers_input_with_password or test_dbg_input)' --ignore=spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py --ignore=spyder/plugins/ipythonconsole/comms/tests/test_comms.py
[  106s] ============================= test session starts ==============================
[  106s] platform linux -- Python 3.8.2, pytest-4.6.9, py-1.8.1, pluggy-0.13.1 -- /usr/bin/python3
[  106s] cachedir: .pytest_cache
[  106s] PyQt5 5.13.2 -- Qt runtime 5.14.1 -- Qt compiled 5.14.1
[  106s] rootdir: /home/abuild/rpmbuild/BUILD/spyder-4.1.1, inifile: pytest.ini
[  106s] plugins: qt-3.3.0, flaky-3.6.1, lazy-fixture-0.6.3, timeout-1.3.4, cov-2.8.1, xvfb-1.2.0, mock-2.0.0
[  126s] collecting ... collected 968 items / 1 errors / 33 deselected / 934 selected
[  126s] 
[  126s] ==================================== ERRORS ====================================
[  126s] _____________ ERROR collecting spyder/app/tests/test_mainwindow.py _____________
[  126s] spyder/app/tests/test_mainwindow.py:48: in <module>
[  126s]     from spyder.app.mainwindow import MainWindow  # Tests fail without this import
[  126s] spyder/app/mainwindow.py:108: in <module>
[  126s]     CLI_OPTIONS, CLI_ARGS = get_options()
[  126s] spyder/app/cli_options.py:133: in get_options
[  126s]     options = parser.parse_args(argv)
[  126s] /usr/lib64/python3.8/argparse.py:1771: in parse_args
[  126s]     self.error(msg % ' '.join(argv))
[  126s] /usr/lib64/python3.8/argparse.py:2521: in error
[  126s]     self.exit(2, _('%(prog)s: error: %(message)s\n') % args)
[  126s] /usr/lib64/python3.8/argparse.py:2508: in exit
[  126s]     _sys.exit(status)
[  126s] E   SystemExit: 2
[  126s] ------------------------------- Captured stderr --------------------------------
[  126s] usage: spyder [options] files
[  126s] py.test-3.8: error: unrecognized arguments: --ignore=_build.python2 --ignore=_build.python3 --ignore=_build.pypy3 -v -k --ignore=spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py --ignore=spyder/plugins/ipythonconsole/comms/tests/test_comms.py
...
Bug Task

Most helpful comment

This is already fixed in PR #11704.

All 4 comments

Ok, only happens when running pytest directly. Works fine with runtests.py.

@CAM-Gerlach anything we should fix on this issue?

This is already fixed in PR #11704.

Alright, my search did not find that PR. Thanks for pointing it out to me!

Was this page helpful?
0 / 5 - 0 ratings