Skip to content

Commit db438b6

Browse files
authored
Merge pull request #92 from LUMC/docimprovement
Slight documentation improvements.
2 parents 27b3787 + 5aff4c4 commit db438b6

File tree

6 files changed

+20
-28
lines changed

6 files changed

+20
-28
lines changed

HISTORY.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ Changelog
99
1010
version 1.3.0-dev
1111
---------------------------
12-
12+
+ Added missing ``help`` section for ``--tag``.
1313
+ Documentation: added usage chapter for pytest-workflow specific options.
14-
+ Added missing `help` for `--tag`.
14+
+ Documentation: updated Cromwell example.
1515
+ Removed redundant references to pylint in code comments and CI.
1616
+ Remove Codacy from the CI.
1717

docs/examples.rst

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,13 @@ repository with the following contents:
4040
4141
{
4242
"final_workflow_outputs_dir": "test-output",
43-
"use_relative_output_paths": true,
44-
"default_runtime_attributes": {
45-
"docker_user": "$EUID"
46-
}
43+
"use_relative_output_paths": true
4744
}
4845
4946
``final_workflow_outputs_dir`` will make sure all the files produced in the
5047
workflow will be copied to the ``final_workflow_outputs_dir``.
5148
``use_relative_output_paths`` will get rid of all the Cromwell specific folders
52-
such as ``call-myTask`` etc. The ``default_runtime_attributes`` are only
53-
necessary when using docker containers. It will make sure all the files are
54-
created by the same user that runs the test (docker containers run as root by
55-
default). This will ensure that files can be deleted by pytest-workflow
56-
afterwards.
49+
such as ``call-myTask`` etc.
5750

5851
The following yaml file tests a Cromwell pipeline. In this case Cromwell is
5952
installed via conda. The conda installation adds a wrapper to Cromwell so it

docs/installation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ In a virtual environment
1010

1111
- Create a new python3 virtual environment.
1212
- Make sure your virtual environment is activated.
13-
- Install using pip ``pip install pytest-workflow``
13+
- Install using pip ``pip install pytest-workflow``.
1414

1515
On Ubuntu or Debian
1616
-------------------
1717

1818
- This requires the ``python3`` and ``python3-pip`` packages to be installed.
1919
- Installing
2020

21-
- system-wide: ``sudo python3 -m pip install pytest-workflow``
21+
- system-wide: ``sudo python3 -m pip install pytest-workflow``.
2222
- for your user only (no sudo needed):
2323
``python3 -m pip install --user pytest-workflow``
2424
- ``pytest`` can now be run with ``python3 -m pytest``.
@@ -43,4 +43,4 @@ To install with conda:
4343
- If you want to use pytest-workflow together with bioconda you can follow
4444
`the instructions here
4545
<https://bioconda.github.io/index.html#set-up-channels>`_.
46-
- ``conda install pytest-workflow``
46+
- ``conda install pytest-workflow``.

docs/running_pytest_workflow.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ The workflows are run automatically. Each workflow gets its own temporary
1414
directory to run. The ``stdout`` and ``stderr`` of the workflow command are
1515
also saved to this directory to ``log.out`` and ``log.err`` respectively.
1616

17+
To check the progress of a workflow while it is running you can use ``tail -f``
18+
on the ``stdout`` or ``stderr`` file of the workflow. The locations of these
19+
files are reported in the log as soon as a workflow is started.
20+
21+
Specific pytest options for pytest workflow
22+
------------------------------------------------
1723

1824
.. argparse::
1925
:module: pytest_workflow.plugin
@@ -53,10 +59,6 @@ To run multiple workflows simultaneously you can use
5359
of workflows that can be run simultaneously. This will speed up things if
5460
you have enough resources to process these workflows simultaneously.
5561

56-
To check the progress of a workflow while it is running you can use ``tail -f``
57-
on the ``stdout`` or ``stderr`` file of the workflow. The locations of these
58-
files are reported in the log as soon as a workflow is started.
59-
6062
Running specific workflows
6163
----------------------------
6264
To run a specific workflow use the ``--tag`` flag. Each workflow is tagged with

docs/writing_tests.rst

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,15 @@ workflow.
8888
8989
@pytest.mark.workflow(name='files containing numbers')
9090
def test_div_by_three(workflow_dir):
91-
number_file = workflow_dir / pathlib.Path("123.txt")
92-
93-
with number_file.open('rt') as file_h:
94-
number_file_content = file_h.read()
95-
91+
number_file = pathlib.Path(workflow_dir, "123.txt")
92+
number_file_content = number_file.read_text()
9693
assert int(number_file_content) % 3 == 0
9794
9895
The ``@pytest.mark.workflow(name='files containing numbers')`` marks the test
99-
as belonging to a workflow named 'files containing numbers'. The mark can also
100-
be written without the explicit ``name`` key as ``@pytest.mark.workflow('files
101-
containing nummbers')``. This test will only run if the workflow 'files
102-
containing numbers' has run.
96+
as belonging to a workflow named ``files containing numbers``. The mark can
97+
also be written without the explicit ``name`` key as
98+
``@pytest.mark.workflow('files containing nummbers')``. This test will only run
99+
if the workflow 'files containing numbers' has run.
103100

104101
``workflow_dir`` is a fixture. It does not work without a
105102
``pytest.mark.workflow('workflow_name')`` mark. This is a

src/pytest_workflow/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def pytest_addoption(parser: PytestParser):
4444
action="store_true",
4545
help="Keep temporary directories where workflows are run for "
4646
"debugging purposes. This also triggers saving of stdout and "
47-
"stderr in the workflow directory",
47+
"stderr in the workflow directory.",
4848
dest="keep_workflow_wd")
4949
parser.addoption(
5050
"--kwdof", "--keep-workflow-wd-on-fail",

0 commit comments

Comments
 (0)