Skip to content

Commit

Permalink
improve testing experience
Browse files Browse the repository at this point in the history
  • Loading branch information
nerdoc committed Oct 21, 2024
1 parent 5c47dd5 commit c03be53
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ In python ecosystem:
To develop pydifact, clone the repository and install the dev requirements:

```
pip install -e .[dev]
make dev
# or
# pip install -e .[dev]
```

This installs all the python packages needed for development and testing.
Expand All @@ -131,15 +133,21 @@ Nevertheless, don't forget adding tests for every aspect you add in code.

### Testing

pydifact uses [pytest](http://pytest.org) for testing.
Just exec `pytest` within the project folder to execute the unit tests. Make sure you installed the library properly before using `pip install -e .[dev]`.
pydifact uses [pytest](http://pytest.org) for testing. There is a shortcut in the Makefile for your convenience:

There is one test to check the performance of parsing huge files, named `test_huge_message` - you can skip that test by calling
```bash
make test
```

This is recommended for faster testing.


There are some additional tests to check the performance of parsing huge files - you can include that tests by calling

```bash
pytest --ignore tests/test_huge_message.py
make test-extended
```
This is recommended for fast testing.



## License
Expand Down
9 changes: 1 addition & 8 deletions tests/test_huge_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,7 @@


# This only a performance benchmark, no real test.
def performance_test_huge_message():
def test_performance_huge_message():
"""Performance test parsing a huge message"""
collection = Interchange.from_file("tests/data/huge_file2.edi")
assert collection


if __name__ == "__main__":
# just call performance test function for profiling purposes
# use this file with:
# $ python -m cProfile -s time tests/test_huge_message.py
performance_test_huge_message()

0 comments on commit c03be53

Please sign in to comment.