forked from spotDL/spotify-downloader
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
62,819 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Running tests | ||
|
||
## Installing dependencies | ||
|
||
All the required dependencies can be installed via `pip`, by using the following command: | ||
|
||
```shell | ||
pip install -e .[test] | ||
``` | ||
|
||
## Executing tests | ||
|
||
After installing all the required modules, just call the following command from the root directory: | ||
|
||
```shell | ||
pytest | ||
``` | ||
|
||
To see code coverage use: | ||
|
||
```shell | ||
pytest --cov=spotdl | ||
``` | ||
|
||
## Enable network communication | ||
|
||
To speed up the test execution, the network requests are mocked. That means that each HTTP | ||
request does not reach the server, and the response is faked by the [vcrpy](https://vcrpy.readthedocs.io/en/latest/index.html) | ||
module. This greatly increases the test performance - in my case <3 seconds vs ~50 seconds, but also | ||
may cause a problem whenever something changes in the real server response. It is recommended to run | ||
the test suite without mocked network from time to time (preferably on CI). | ||
|
||
To run tests with a real network communication use this command: | ||
|
||
```shell | ||
pytest --disable-vcr | ||
``` | ||
|
||
Whenever the server response will change and affect the tests behavior, the stored responses can be updated | ||
by wiping the [tests/cassetes](tests/cassetes) directory and running `pytest` again (without `--disable-vcr`). |
Empty file.
Oops, something went wrong.