Skip to content

stop using deprecated setuptools.command.test #140

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
24 changes: 11 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
import io
import os
import sys
from sys import exit
from setuptools import setup
from setuptools.command.test import test as TestCommand
from setuptools import setup, Command
import subprocess

## CONFIG
Expand Down Expand Up @@ -64,18 +62,18 @@ def version_info(target_version):
with io.open('README.md', 'r', encoding='utf-8') as fh:
long_description = fh.read()

## PyTest
# This is a plug-in for setuptools that will invoke py.test
# when you run python setup.py test
class PyTest(TestCommand):
## Custom test command to run pytest
class PyTest(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
pass
def run(self):
import pytest
errno = pytest.main([])
sys.exit(errno)

def run_tests(self):
import pytest # import here, because outside the required eggs aren't loaded yet
exit(pytest.main(self.test_args))


version = sys.version_info
Expand Down