Skip to content

681 update readme with instructions for runnig tests #682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,30 @@ nb = pynetbox.api(
)
```

## Running Tests

First, create and activate a Python virtual environment in the pynetbox directory to isolate the project dependencies:

```python
python3 -m venv venv
source venv/bin/activate
```

Install both requirements files:

```python
pip install -r requirements.txt
pip install -r requirements-dev.txt
```

The test suite requires Docker to be installed and running, as it will download and launch netbox-docker containers during test execution.

With Docker installed and running, execute the following command to run the test suite:

```python
pytest
```

## Alternative Library

> **Note:** For those interested in a different approach, there is an alternative Python API client library available for NetBox called [netbox-python](https://github.com/netbox-community/netbox-python). This library provides a thin Python wrapper over the NetBox API.
Expand Down