Skip to content

Commit ad72736

Browse files
authored
Merge pull request #9 from SimplePEG/feature-pytest-integration
Feature pytest integration
2 parents 2e97d51 + 409f9b2 commit ad72736

File tree

71 files changed

+209
-177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+209
-177
lines changed

.coveragerc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[run]
2+
omit = tests/*

.travis.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
language: python
22
python:
33
- "2.7"
4-
# command to install dependencies
5-
install:
6-
- pip install .
7-
- pip install coveralls
8-
# command to run tests
9-
script:
10-
coverage run --omit=*/tests/* --source=simplepeg setup.py test
11-
after_success:
12-
coveralls
4+
install: pip install tox-travis
5+
script: tox

setup.py

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
#!/usr/bin/env python
2+
import sys
3+
14
from setuptools import setup
5+
from setuptools.command.test import test as TestCommand
26

37

48
def readme():
@@ -11,6 +15,26 @@ def license_text():
1115
return f.read()
1216

1317

18+
class Tox(TestCommand):
19+
def initialize_options(self):
20+
TestCommand.initialize_options(self)
21+
self.tox_args = None
22+
23+
def finalize_options(self):
24+
TestCommand.finalize_options(self)
25+
self.test_args = []
26+
self.test_suite = True
27+
28+
def run_tests(self):
29+
import tox
30+
import shlex
31+
args = self.tox_args
32+
if args:
33+
args = shlex.split(self.tox_args)
34+
errno = tox.cmdline(args)
35+
sys.exit(errno)
36+
37+
1438
setup(name='simplepeg',
1539
version='1.0.3',
1640
description='Python version of SimplePEG',
@@ -26,8 +50,8 @@ def license_text():
2650
author_email='[email protected]',
2751
keywords='peg parser grammar',
2852
license=license_text(),
29-
test_suite='nose.collector',
30-
tests_require=['nose'],
53+
tests_require=['pytest', 'tox'],
54+
cmdclass={'test': Tox},
3155
packages=['simplepeg'],
3256
include_package_data=True,
3357
zip_safe=False)

simplepeg/tests/__init__.py

Whitespace-only changes.

simplepeg/tests/test_rd_parser_combo.py

Lines changed: 0 additions & 62 deletions
This file was deleted.

simplepeg/tests/test_speg_exceptions.py

Lines changed: 0 additions & 41 deletions
This file was deleted.

simplepeg/tests/test_speg_fixtures.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

simplepeg/tests/test_speg_parser_fixtures.py

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)