Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
mosquito committed Sep 17, 2021
1 parent 86c0bfb commit 9a2bb7f
Show file tree
Hide file tree
Showing 10 changed files with 529 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[run]
branch = True
omit =
*/env*/*
*/tests/*
*/.*/*
25 changes: 25 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true

[*.{py,yml}]
indent_style = space

[*.py]
indent_size = 4

[docs/**.py]
max_line_length = 80

[*.rst]
indent_size = 4

[Makefile]
indent_style = tab

[*.yml]
indent_size = 2
89 changes: 89 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ${{ matrix.os }}

strategy:
matrix:
include:
- python: '3.9'
toxenv: mypy
os: ubuntu-latest

- python: '3.9'
toxenv: pylava
os: ubuntu-latest

- python: '3.9'
toxenv: checkdoc
os: ubuntu-latest

- python: '3.6'
toxenv: py36
os: ubuntu-latest
- python: '3.7'
toxenv: py37
os: ubuntu-latest
- python: '3.8'
toxenv: py38
os: ubuntu-latest
- python: '3.9'
toxenv: py39
os: ubuntu-latest

- python: '3.6'
toxenv: py36
os: macos-latest
- python: '3.7'
toxenv: py37
os: macos-latest
- python: '3.8'
toxenv: py38
os: macos-latest
- python: '3.9'
toxenv: py39
os: macos-latest

- python: '3.6'
toxenv: py36
os: windows-latest
- python: '3.7'
toxenv: py37
os: windows-latest
- python: '3.8'
toxenv: py38
os: windows-latest
- python: '3.9'
toxenv: py39
os: windows-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}

- name: Install tox
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
TOXENV: ${{ matrix.toxenv }}
run: pip install tox wheel

- name: Tests
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
FORCE_COLOR: yes
TOXENV: ${{ matrix.toxenv }}
run: tox
166 changes: 166 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# Created by .ignore support plugin (hsz.mobi)
### VirtualEnv template
# Virtualenv
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
.Python
[Bb]in
[Ii]nclude
[Ll]ib
[Ll]ib64
[Ll]ocal
[Ss]cripts
pyvenv.cfg
.venv
pip-selfcheck.json
### IPythonNotebook template
# Temporary data
.ipynb_checkpoints/
### Python template
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/
docs/source/apidoc

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

/htmlcov
/temp
.DS_Store

/*/version.py

.pytest_cache

# Created by https://www.gitignore.io/api/vim
# Edit at https://www.gitignore.io/?templates=vim

### Vim ###
# Swap
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]

# Session
Session.vim

# Temporary
.netrwhist
*~
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~

# End of https://www.gitignore.io/api/vim
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include README.rst
67 changes: 67 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
.. image:: https://coveralls.io/repos/github/mosquito/pytest-rst/badge.svg?branch=master
:target: https://coveralls.io/github/mosquito/pytest-rst
:alt: Coveralls

.. image:: https://github.com/aiokitchen/pytest-rst/workflows/tox/badge.svg
:target: https://github.com/aiokitchen/pytest-rst/actions?query=workflow%3Atox
:alt: Actions

.. image:: https://img.shields.io/pypi/v/pytest-rst.svg
:target: https://pypi.python.org/pypi/pytest-rst/
:alt: Latest Version

.. image:: https://img.shields.io/pypi/wheel/pytest-rst.svg
:target: https://pypi.python.org/pypi/pytest-rst/

.. image:: https://img.shields.io/pypi/pyversions/pytest-rst.svg
:target: https://pypi.python.org/pypi/pytest-rst/

.. image:: https://img.shields.io/pypi/l/pytest-rst.svg
:target: https://pypi.python.org/pypi/pytest-rst/


pytest-rst run python tests in ReStructuredText
===============================================

Code block must have ``:name:`` attribute starts with ``test_``.

Example
-------

This block will running as a pytest test-case:

.. code-block:: rst
.. code-block:: python
:name: test_first
assert True
.. code-block:: python
:name: test_first
assert True
This block just not running:

.. code-block:: rst
.. code-block:: python
# not a test
assert False
.. code-block:: python
# not a test
assert False
Versioning
----------

This software follows `Semantic Versioning`_


.. _Semantic Versioning: http://semver.org/
6 changes: 6 additions & 0 deletions pylava.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[pylava]
ignore=C901,E252
skip = *env*,.tox*,*build*,.*

[pylava:pycodestyle]
max_line_length = 80
Loading

0 comments on commit 9a2bb7f

Please sign in to comment.