Skip to content

Commit c630d16

Browse files
authored
Merge pull request #163 from JAGADISHSUNILPEDNEKAR/Fixing_issue_158
Fixing the pytest errors
2 parents 3dfc49e + 9114ddf commit c630d16

1 file changed

Lines changed: 26 additions & 16 deletions

File tree

CONTRIBUTING.md

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Thank you for considering contributing to the `python-bitcoin-utils` project! Yo
77
### 1. Reporting Issues
88

99
If you encounter any bugs, unexpected behavior, or have feature requests, please open an issue on the [GitHub Issues](https://github.com/karask/python-bitcoin-utils/issues) page. When reporting a bug, provide the following information:
10-
1110
- A clear description of the issue.
1211
- Steps to reproduce the issue.
1312
- Expected behavior.
@@ -26,19 +25,18 @@ We welcome pull requests! To contribute code:
2625

2726
1. Fork the repository on GitHub.
2827
2. Clone your fork to your local machine:
29-
```sh
30-
git clone https://github.com/your-username/python-bitcoin-utils.git
31-
cd python-bitcoin-utils
32-
```
28+
```sh
29+
git clone https://github.com/your-username/python-bitcoin-utils.git
30+
cd python-bitcoin-utils
31+
```
3332
3. Add the upstream repository to keep your fork updated:
34-
```sh
35-
git remote add upstream https://github.com/karask/python-bitcoin-utils.git
36-
```
33+
```sh
34+
git remote add upstream https://github.com/karask/python-bitcoin-utils.git
35+
```
3736

3837
#### Step 2: Create a Feature Branch
3938

4039
Create a new branch for your changes:
41-
4240
```sh
4341
git checkout -b feature-name
4442
```
@@ -47,6 +45,11 @@ git checkout -b feature-name
4745

4846
- Follow the project's coding style.
4947
- Ensure your code is well-documented and includes meaningful commit messages.
48+
- Install the package in development mode before running tests:
49+
```sh
50+
pip install -e .
51+
```
52+
This creates an editable installation linking to your local code, which is necessary for the tests to properly discover and import modules.
5053
- Run tests before submitting a pull request:
5154
```sh
5255
pytest tests/
@@ -56,9 +59,9 @@ git checkout -b feature-name
5659
#### Step 4: Submit a Pull Request
5760

5861
1. Push your changes to your fork's branch:
59-
```sh
60-
git push origin feature-name
61-
```
62+
```sh
63+
git push origin feature-name
64+
```
6265
2. Open a pull request from your fork's branch to the `master` branch of the original repository.
6366
3. Provide a detailed description of your changes.
6467
4. Address any requested changes from maintainers.
@@ -78,11 +81,9 @@ git checkout -b feature-name
7881
### 5. Writing Tests
7982

8083
Ensure new features and bug fixes include test cases. The project uses `pytest` for testing. Run all tests with:
81-
8284
```sh
8385
pytest
8486
```
85-
8687
If you add new features, create corresponding test cases under the `tests/` directory. Ensure your tests cover:
8788
- Normal expected operation
8889
- Edge cases
@@ -92,10 +93,19 @@ If you add new features, create corresponding test cases under the `tests/` dire
9293

9394
Help improve the documentation by submitting corrections, clarifications, or examples. Update the README or other documentation files as needed.
9495

96+
### 7. Troubleshooting Test Failures
97+
98+
If you encounter test failures when running the test suite, check for these common issues:
99+
100+
- **Module import errors**: Make sure you've installed the package in development mode with `pip install -e .`
101+
- **API mismatch errors**: If tests are failing with TypeError or similar errors about function signatures, check if there have been recent API changes in the corresponding modules.
102+
- **Transaction hex mismatches**: Assertion errors in transaction tests with hex string differences often indicate changes in transaction serialization or signature generation logic.
103+
104+
For specific test failures, please refer to the test file and the corresponding implementation to understand the expected behavior.
105+
95106
## Code of Conduct
96107

97108
Be respectful and follow the open-source community guidelines. Maintain a collaborative and inclusive environment.
98109

99110
---
100-
101-
Thank you for contributing! 🚀
111+
Thank you for contributing! 🚀

0 commit comments

Comments
 (0)