Skip to content
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

Move tests into a separate package #61

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
3 changes: 0 additions & 3 deletions .coveragerc

This file was deleted.

8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ python:
- 3.6

install:
- pip install -e .[dev]
- pip install -r requirements_ci.txt
- pip install codecov

script:
- py.test codetransformer
- python setup.py test
- flake8 codetransformer

after_success:
- codecov

notifications:
email: false
4 changes: 3 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
``codetransformer``
===================

|build status| |documentation|
|build status| |coverage| |documentation|

Bytecode transformers for CPython inspired by the ``ast`` module's
``NodeTransformer``.
Expand Down Expand Up @@ -260,6 +260,8 @@ https://github.com/llllllllll/codetransformer.
.. _opcode: https://docs.python.org/3.5/library/dis.html#opcode-NOP
.. |build status| image:: https://travis-ci.org/llllllllll/codetransformer.svg?branch=master
:target: https://travis-ci.org/llllllllll/codetransformer
.. |coverage| image:: https://codecov.io/gh/llllllllll/codetransformer/branch/master/graph/badge.svg
:target: https://codecov.io/gh/llllllllll/codetransformer
.. |documentation| image:: https://readthedocs.org/projects/codetransformer/badge/?version=stable
:target: http://codetransformer.readthedocs.io/en/stable/?badge=stable
:alt: Documentation Status
3 changes: 3 additions & 0 deletions requirements_ci.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
flake8==3.4.1
pytest==3.2.1
pytest-cov==2.5.1
10 changes: 10 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,13 @@ versionfile_source=codetransformer/_version.py
versionfile_build=codetransformer/_version.py
tag_prefix=
parentdir_prefix=codetransformer-

[aliases]
test=pytest

[coverage:run]
omit=codetransformer/_version.py

[tool:pytest]
addopts=--doctest-modules --cov=codetransformer --cov-report=term-missing --cov-report=html --cov-branch --ignore=setup.py
testpaths=tests
9 changes: 2 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@
],
url='https://github.com/llllllllll/codetransformer',
install_requires=['toolz'],
extras_require={
'dev': [
'flake8==3.3.0',
'pytest==2.8.4',
'pytest-cov==2.2.1',
],
},
setup_requires=['pytest-runner'],
tests_require=['pytest', 'pytest-cov', 'flake8']
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
reason='decompiler only runs on 3.4',
)
if _343:
from ..decompiler import (
from codetransformer.decompiler import (
DecompilationContext,
decompile,
paramnames,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ..add2mul import add2mul
from codetransformer.transformers.add2mul import add2mul


def test_add2mul():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest

from codetransformer.code import Code
from ..constants import asconstants
from codetransformer.transformers.constants import asconstants


basename = os.path.basename(__file__)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pytest import raises
from ..pattern_matched_exceptions import pattern_matched_exceptions
from codetransformer.transformers.pattern_matched_exceptions import pattern_matched_exceptions


def test_patterns():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from ..interpolated_strings import interpolated_strings
from codetransformer.transformers.interpolated_strings import interpolated_strings


pytestmark = pytest.mark.skipif(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from decimal import Decimal
from itertools import islice

from ..literals import (
from codetransformer.transformers.literals import (
islice_literals,
overloaded_dicts,
overloaded_bytes,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from codetransformer.code import Code
from codetransformer.instructions import BUILD_SLICE, LOAD_CONST

from ..precomputed_slices import precomputed_slices
from codetransformer.transformers.precomputed_slices import precomputed_slices


def test_precomputed_slices():
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from textwrap import dedent
from types import CodeType

from ..pretty import a, walk_code
from codetransformer.utils.pretty import a, walk_code


def test_a(capsys):
Expand Down
9 changes: 2 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,5 @@ skip_missing_interpreters=True

[testenv]
commands=
pip install -e .[dev]
py.test

[pytest]
addopts = --doctest-modules --cov codetransformer --cov-report term-missing --ignore setup.py
testpaths = codetransformer
norecursedirs = decompiler
pip install -r requirements_ci.txt
python setup.py test