https://github.com/ninjascl/python-test-env
A testing environment for Python Scripts
https://github.com/ninjascl/python-test-env
Last synced: 10 months ago
JSON representation
A testing environment for Python Scripts
- Host: GitHub
- URL: https://github.com/ninjascl/python-test-env
- Owner: NinjasCL
- License: mit
- Created: 2020-07-10T01:00:32.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-10T02:50:42.000Z (almost 6 years ago)
- Last Synced: 2025-01-21T03:42:16.955Z (over 1 year ago)
- Language: Python
- Size: 8.79 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
# Python Testing Environment
This is a simple environment for testing out
_Python_ scripts. Ideally for studing algorithms and data structures.
image:https://github.com/ninjascl/python-test-env/workflows/docker-ci/badge.svg[Test Status]
## Requirements
- https://www.docker.com/[Docker]
- https://en.wikipedia.org/wiki/Makefile[Make]
## Available Tools
- https://github.com/docker-library/python/tree/master/3.8[Python 3.8]
- https://docs.pytest.org/en/stable/getting-started.html[pytest]
- https://github.com/psf/black[black]
- https://pypi.org/project/typing-extensions/[typing-extensions]
## Usage
### Makefile
All the commands are inside this file. You can modify
`IMAGE` and `RUN` variables to suit your needs.
### `$ make build`
This command will create the `container`.
### `$ make format`
This command will execute _Black_ code formatter.
### `$ make run`
This command will execute _Python_ REPL inside the container.
### `$ make shell`
This command will enter the _Bash_ shell inside the container.
### `$ make test`
This command will execute _Pytest_ inside the container.
### _Taskfile.sh_
`Taskfile.sh` is a special file that helps running commands inside the container. To execute it first use `$ make shell` to enter the container. Then you can use `run` to execute commands defined in `Taskfile.sh`.
#### `$ run test`
Runs _Pytest_.
#### `$ run test:file `
Runs _Pytest_ on a file named `test/test_.py`
#### `$ run test:file:fn ""`
Runs _Pytest_ on a file named `test/test_.py` and execute all the methods wich contains the words inside "".
See https://docs.pytest.org/en/latest/example/index.html
++++
Made with ♥ by Ninjas.cl.
++++