Skip to content

Commit 10a6163

Browse files
Adolgert limit pytest path (#137)
* Add pytest to main readme and configure tests directory with pytest.ini * responses to PR comments to add pytest-3 and fix a typo. --------- Co-authored-by: Drew Dolgert <[email protected]>
1 parent c53732a commit 10a6163

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ which creates a lib folder, moves the built `.so` file into that lib folder, and
9191

9292
**Note** You may wish to copy the `.so` file to any projects of your own, or add it to your system path to source from.
9393

94+
## Running Tests
95+
96+
Run tests with [pytest](https://docs.pytest.org), which may be called `pytest-3` on your system. See the [testing readme](tests/README.md) for more information.
97+
98+
```bash
99+
pytest [--run-long]
100+
```
101+
94102
## Code Examples
95103

96104
To get familiar with the OpenFHE Python API, check out the examples:

pytest.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[pytest]
2+
testpaths =
3+
tests

tests/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Working with Tests
22

3-
These tests use Pytest (https://docs.pytest.org/).
3+
These tests use [Pytest](https://docs.pytest.org/).
44

55
## Running and Using Tests
66

7-
These tests assume that openfhe-python is installed in the current python environment, which you can check by running
7+
These tests assume that openfhe-python is installed in the current python environment, which you can check by importing openfhe.
88
```bash
99
python -c "__import__('openfhe')"
1010
```
@@ -22,7 +22,7 @@ pytest --run-all
2222

2323
### General Pytest usage
2424

25-
Test a particular file:
25+
This is a quick reminder of pytest's features. To test a particular file:
2626

2727
```bash
2828
pytest test_particular_file.py
@@ -35,7 +35,8 @@ Test all functions matching a name. For instance, this would pick up
3535
pytest -k add
3636
```
3737

38-
As a reminder, pytest can be helpful for debugging.
38+
As a reminder, pytest can be helpful for debugging. This command-line option
39+
shows debug output from logging statements.
3940

4041
```bash
4142
pytest --log-cli-level=debug
@@ -64,7 +65,7 @@ The goal is for the Github Actions tests to reassure a committer that they have
6465
not broken the Python wrapper.
6566

6667
**Import OpenFHE as fhe** -- Unit tests tend to use more imports than most
67-
code, for instance JSON, which conflicts with an OpenFHE name, so quality
68+
code, for instance JSON, which conflicts with an OpenFHE name, so qualify
6869
imports in the tests.
6970

7071
```python

0 commit comments

Comments
 (0)