Skip to content

Commit c03be53

Browse files
committed
improve testing experience
1 parent 5c47dd5 commit c03be53

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ In python ecosystem:
117117
To develop pydifact, clone the repository and install the dev requirements:
118118

119119
```
120-
pip install -e .[dev]
120+
make dev
121+
# or
122+
# pip install -e .[dev]
121123
```
122124

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

132134
### Testing
133135

134-
pydifact uses [pytest](http://pytest.org) for testing.
135-
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]`.
136+
pydifact uses [pytest](http://pytest.org) for testing. There is a shortcut in the Makefile for your convenience:
136137

137-
There is one test to check the performance of parsing huge files, named `test_huge_message` - you can skip that test by calling
138+
```bash
139+
make test
140+
```
141+
142+
This is recommended for faster testing.
143+
144+
145+
There are some additional tests to check the performance of parsing huge files - you can include that tests by calling
138146

139147
```bash
140-
pytest --ignore tests/test_huge_message.py
148+
make test-extended
141149
```
142-
This is recommended for fast testing.
150+
143151

144152

145153
## License

tests/test_huge_message.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,7 @@
1717

1818

1919
# This only a performance benchmark, no real test.
20-
def performance_test_huge_message():
20+
def test_performance_huge_message():
2121
"""Performance test parsing a huge message"""
2222
collection = Interchange.from_file("tests/data/huge_file2.edi")
2323
assert collection
24-
25-
26-
if __name__ == "__main__":
27-
# just call performance test function for profiling purposes
28-
# use this file with:
29-
# $ python -m cProfile -s time tests/test_huge_message.py
30-
performance_test_huge_message()

0 commit comments

Comments
 (0)