Skip to content

Commit

Permalink
Removed --unattended cmd line option for pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreRaybaut committed Oct 16, 2023
1 parent 40f7309 commit 28d71cb
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest plotpy --unattended
pytest plotpy
4 changes: 2 additions & 2 deletions doc/dev/build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ To run the unittests, you need:

Then run the following command::

pytest -v --unattended plotpy
pytest plotpy

To run test with coverage support, use the following command::

pytest -v --cov --cov-report=html --unattended plotpy
pytest -v --cov --cov-report=html plotpy


Code formatting
Expand Down
2 changes: 1 addition & 1 deletion doc/dev/contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Before submitting a patch, please check the following points:

.. code-block:: bash
pytest --unattended plotpy
pytest plotpy
Pull request
~~~~~~~~~~~~
Expand Down
4 changes: 2 additions & 2 deletions doc/dev/platforms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ That's it, you can now run the tests using the following command:

.. code-block:: bash
pytest --unattended plotpy
pytest plotpy
If you want to rely on Visual Studio Code for editing and take advantage of the
project settings and tasks, you will need to set the following environment variable:
Expand Down Expand Up @@ -160,4 +160,4 @@ That's it, you can now run the tests using the following command:

.. code-block:: bash
pytest --unattended plotpy
pytest plotpy
11 changes: 3 additions & 8 deletions plotpy/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# content of conftest.py

from guidata.env import execenv

def pytest_addoption(parser):
"""Add custom options to the pytest command line."""
parser.addoption(
"--unattended",
action="store_true",
default=None,
help="Unattended mode for gui tests",
)
# Turn on unattended mode for executing tests without user interaction
execenv.unattended = True
2 changes: 1 addition & 1 deletion scripts/run_coverage.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ call %FUNC% SetPythonPath
call %FUNC% UsePython

set COVERAGE_PROCESS_START=%SCRIPTPATH%\..\.coveragerc
pytest -v --cov --cov-report=html --unattended %MODNAME%
pytest -v --cov --cov-report=html %MODNAME%
start .\htmlcov\index.html
call %FUNC% EndOfScript
2 changes: 1 addition & 1 deletion scripts/run_pytest.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ for /D %%d in ("%DIR0%*") do (
set WINPYDIRBASE=%%d
call !WINPYDIRBASE!\scripts\env.bat
echo Running pytest from "%%d":
pytest --ff -q --unattended %MODNAME%
pytest --ff -q %MODNAME%
echo ----
)
call %FUNC% EndOfScript

0 comments on commit 28d71cb

Please sign in to comment.